Skip to content

Conversation

@wilzbach
Copy link
Member

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

  • it's the sane default. A user should explicitly expose his server to the world
  • `listenHTTP(":8080") is a convenient shorthand for which Vibe.d should just listen on localhost

@dejlek
Copy link

dejlek commented May 2, 2018

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.

@wilzbach
Copy link
Member Author

wilzbach commented May 2, 2018

Why is binding to localhost a better alternative than binding to any available interface??

Because you don't want to expose your application to the public interface by default.
That should be a conscious choice by the programmer.

However, if the code by default binds to any interface, you should be able to connect to your docker container.

Yep, and that should be a conscious choice as otherwise it's really easy to accidentally expose your application to the world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants