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

Plackup does not support setting port to 0 #534

Open
frioux opened this issue Nov 5, 2015 · 4 comments
Open

Plackup does not support setting port to 0 #534

frioux opened this issue Nov 5, 2015 · 4 comments

Comments

@frioux
Copy link
Contributor

frioux commented Nov 5, 2015

I would like to have plackup get a port from the kernel that is ensured to be open. The correct way to do this is to set the port to 0 and the kernel will assign a free port to the socket. If you tell plackup to use port 0 (or listen 0:0) it will just use one of the predefined ports, instead of letting the kernel choose.

I suspect that the fix for this involves checking definedness instead of truthiness on the value you get back, but I'm not sure.

@miyagawa
Copy link
Member

miyagawa commented Nov 5, 2015

plackup does seem to support --listen 0:0 and then individual servers might default to other ports if they do not support automatic allocation of the port. (HTTP::Server::PSGI, the default backend, seems to default to 8080 then)

@frioux
Copy link
Contributor Author

frioux commented Nov 5, 2015

Ok, so I'd say then that this bug is on HTTP::Server::PSGI

@miyagawa
Copy link
Member

miyagawa commented Nov 5, 2015

I don't consider it a bug it's a feature request :)

@frioux
Copy link
Contributor Author

frioux commented Nov 5, 2015

Ah sure, wasn't really trying to make that distinction

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

2 participants