Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default bindAddress to 127.0.0.1 #2086

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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