Closed ibnesayeed closed 6 years ago
I noticed if running a docker command with a port forwarding (-p), the server would not respond unless I use 0.0.0.0 instead of 127.0.0.1.
So, I will change it so that 0.0.0.0 becomes the default.
Yes, that's what I meant by unexpected results. The reason why listening to 127.0.0.1
or localhost
does not work in containers is that loopback interface inside a container is limited to the container itself and won't allow any traffic from the host machine. However, 0.0.0.0
is a listening interface which means listen to all interfaces defined in the machine (in this case the container) which also includes the loopback interface. One important thing to notice here is that 0.0.0.0
is never used to make request because it is a not a valid routing interface.
Changing the default host to
0.0.0.0
would slim down the readme and cause fewer unexpected results.