Closed sordak closed 4 years ago
There are 2 things worth considering:
{ {8088, "172.25.0.7"} , ejabberd_cowboy, [
I think you can change it to:
{ 8088 , ejabberd_cowboy, [
which will start the endpoint on all available network interfaces (most probably only one one in a container).HOST
header in a HTTP request. When you configure the routes like below:
{modules, [
{"172.25.0.7", "/api", mongoose_api_admin, []}
]}
You basically tell MongooseIM to accept only these request which has "172.25.0.7"
as a value of the Host
header. I suggest changing it to "_"
which tells the server to accept any Host
value.
The following config worked for me:
{ 8088 , ejabberd_cowboy, [
{num_acceptors, 10},
{transport_options, [{max_connections, 1024}]},
{modules, [
{"_", "/api", mongoose_api_admin, []}
]}
]},
Please, keep in mind the the API exposed on port 8088 doesn't have any authentication layer and allows to manipulate the server. It's meant to be accessible only from your other backend services so you may want to put some restrictions who can access it.
Solved. Thank you!
I have host with IP 172.17.0.148. There is mongooseim-docker with IP 172.25.0.7 on that host. Cowboy is listening to port 8088. Configuration is default except next lines:
I'm running mongooseim-docker with next command:
I am getting answer if I run next on host:
But I can't get any answer when I run command from servers from 172.17.0.0 network. Say, from server with IP 172.17.0.150:
I have tried to substitute 172.25.0.7 with 0.0.0.0, 127.0.0.1 and 172.17.0.148 in mongooseim.cfg, but it didn't help.
I can 'telnet 172.17.0.148 8088' from 172.17.0.150 and make 'GET'. It gives me the next:
Execution of 'telnet 172.17.0.148 5222' from 172.17.0.150 gives:
Question:
How do I configure mongooseim (cowboy), so I could make requests from servers from 172.17.0.0 network?