[ejabberd] mod_rest

Badlop badlop at gmail.com
Wed Aug 23 11:45:37 MSK 2017


Hi,

I imagine you have something like this:
hosts:
 - "example.com"
But later in the wget query you send the request to "localhost". This
is what the error complains about.

Two possible solutions:
A) Send the request to example.com, or whatever vhost you have enabled
in ejabberd.yml
B) Or add localhost to the list of vhosts served by ejabberd

--
Badlop
ProcessOne



On 22 August 2017 at 05:02, Ricky Gutierrez <xserverlinux at gmail.com> wrote:
> Hi, I am building an application in php and mysql and I want to
> connect it with my ejabberd server 17.08 to send a direct message to
> my users, I am using this module but when I make the connection with
> wget it gives me some errors:
>
> wget http://localhost:5285/rest/ --server-response --post-data
> '<message to=“myuser at localhost" from="localhost/rest"><body>hola aqui
> estoy</body></message>'
>
>
> 2017-08-21 20:46:59.425 [info] <0.344.0>@ejabberd_listener:accept:302
> (<0.537.0>) Accepted connection 127.0.0.1:39508 -> 127.0.0.1:5285
> 2017-08-21 20:46:59.425 [info] <0.537.0>@ejabberd_http:init:149
> started: {gen_tcp,#Port<0.22872>}
> 2017-08-21 20:46:59.426 [error] <0.537.0> CRASH REPORT Process
> <0.537.0> with 0 neighbours crashed with reason:
> {module_must_be_started_in_vhost,mod_rest,<<"localhost">>} in
> mod_rest:try_get_option/3 line 114
> 2017-08-21 20:47:02.426 [info] <0.344.0>@ejabberd_listener:accept:302
> (<0.538.0>) Accepted connection 127.0.0.1:39510 -> 127.0.0.1:5285
>
> I show the configuration I'm using
>
> my config:
>
>  -
>
>     port: 5285
>     module: ejabberd_http
>     request_handlers:
>        "/rest": mod_rest
>
>
>
> mod_rest:
>     allowed_ips:
>       - "127.0.0.1"
>     allowed_stanza_types:
>       - "message"
>       - "presence"
>       - "iq"
>
>
> any idea list?
>
>
> --
> rickygm
>
> http://gnuforever.homelinux.com
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd


More information about the ejabberd mailing list