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

PP-13145: Bind to localhost by default instead of 0.0.0.0 #3900

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

jfharden
Copy link
Contributor

@jfharden jfharden commented Sep 5, 2024

WHAT

Bind to 127.0.0.1 by default, instead of 0.0.0.0

How

On master run:
npm run start:dev then when the app is running run, in another terminal run netstat, you'll see it's listening on all interfaces

$ netstat -anl | grep 3000
tcp46      0      0  *.3000                                        *.*                                           LISTEN

Then change to this branch, ryun npm run start:dev again and then netcat again, and you'll see it's listening on 127.0.0.1

$ netstat -anl | grep 3000
tcp4       0      0  127.0.0.1.3000                                *.*                                           LISTEN

Then kill the app, and to prove the env var works run BIND_HOST=0.0.0.0 npm run start:dev then a final netcat, and you'll see it's listening on all interfaces again

$ netstat -anl | grep 3000
tcp4       0      0  *.3000                                        *.*                                           LISTEN

@jfharden jfharden merged commit 80a67f4 into master Sep 5, 2024
9 checks passed
@jfharden jfharden deleted the pp-13145/bind-to-localhost-by-default branch September 5, 2024 15:31
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