Change default bindAddress to 127.0.0.1#2086
Conversation
|
Why is binding to localhost a better alternative than binding to any available interface?? Imagine your CI/CD pipeline includes generation of a docker image, you run it, and want to test... - You will not be able to use the 127.0.0.1 . However, if the code by default binds to any interface, you should be able to connect to your docker container. |
Because you don't want to expose your application to the public interface by default.
Yep, and that should be a conscious choice as otherwise it's really easy to accidentally expose your application to the world. |
An alternative if you want people to be explicit would be to use a empty bind address, check for it in
listenHTTP, still set the old bindAddress, but trigger a "deprecation message" to the log.Arguments for 127.0.0.1