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

Request the running port number using port 0 #998

Closed
gmschouten opened this issue Jul 19, 2017 · 2 comments
Closed

Request the running port number using port 0 #998

gmschouten opened this issue Jul 19, 2017 · 2 comments

Comments

@gmschouten
Copy link

Do you want to request a feature or report a bug?
feature

What is the current behavior?

server.listen(0, '127.0.0.1', () => {
 // port will automaticly assign to a free port.
});

What is the expected behavior?

server.listen(0, '127.0.0.1', () => {});

server.once('listening', () => {
   // while running we want to request the used port number.
   const port = server.address().port;
});

If this is a feature request, what is motivation or use case for changing the behavior?
I use webpack-dev-server to serve my application for browser-test. I want webpack to use a free port and after serving to tell my browser-test where to find the test-pages.

Please mention your webpack and Operating System version.
webpack: 3.3.0
webpack-dev-server: 2.5.1

@shellscape
Copy link
Contributor

We'd welcome a PR to implement this feature.

@shellscape
Copy link
Contributor

this should be resolved by #1054. if it's not, please give me a ping.

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

No branches or pull requests

2 participants