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

port 0 #1

Open
mscdex opened this issue Sep 4, 2013 · 0 comments
Open

port 0 #1

mscdex opened this issue Sep 4, 2013 · 0 comments

Comments

@mscdex
Copy link

mscdex commented Sep 4, 2013

You can bind to port 0 (or just supply a function to .listen() as shown in the docs) which will allow the OS to assign an unused port. Then once the server is listening, you can get the assigned port via server.address().port.

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

No branches or pull requests

1 participant