Skip to content

Feature: add --find-port parameter #364

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

Closed
wants to merge 2 commits into from
Closed

Feature: add --find-port parameter #364

wants to merge 2 commits into from

Conversation

harttle
Copy link

@harttle harttle commented May 3, 2017

Find a free port when the port given by -p is not available. Solves #363

@ahmetb
Copy link

ahmetb commented Aug 3, 2017

I think this should be implemented as -p 0 flag. See #386.

@harttle harttle mentioned this pull request Aug 4, 2017
@BigBlueHat
Copy link
Member

@harttle would you have time/interest in writing some tests for this new feature? The code looks good, and the use case you expressed in #386 (comment) may not be that uncommon (i.e. wanting a port "above" a certain number). Thanks!

@harttle
Copy link
Author

harttle commented Aug 13, 2017

This should be sufficient, yet not complete. Since bin/http-server wasn't tested before, it's hard to do complete test for it. For instance, the stdout/stderr.

@thornjad thornjad self-requested a review February 28, 2019 14:27
@thornjad thornjad added this to the v0.12.0 milestone Feb 28, 2019
@thornjad
Copy link
Member

Given the discussion in #386, would this feature maybe be better implemented as a --base-port which is the same as the default behavior of no --port given, but searching begins at --base-port?

My concern with the -p XXXX --find-port pattern is that the user is both specifying a port and expecting that the port may end up something other than what is specified. I think it may be more clear if an error is thrown when the port the user wants is in use. Then if the user wants to search for a port, they don't use -p and may optionally determine the base port to start at.

@BigBlueHat @harttle @ahmetb any thoughts on a --base-port approach?

@sumitparakh
Copy link

sumitparakh commented Jul 17, 2019

What is the status of this PR? Any possibility of implementing it ?

@harttle
Copy link
Author

harttle commented Jul 17, 2019

Sorry I forgot this for a white and deleted that forked repo unexpectedly, I tried and could not restore that commit which is needed to continue patching this pull request. It's confirmed by this question from stackexchange. If that's the way, we should open another PR for #386 and this should be closed. @thornjad

@sumitparakh
Copy link

Hi @harttle @thornjad . Would you mind if i try this?

@thornjad thornjad modified the milestones: v0.12.0, v0.13.0 Nov 19, 2019
@thornjad
Copy link
Member

thornjad commented Nov 19, 2019

Closing since the fork is gone, and we have #544

@thornjad thornjad closed this Nov 19, 2019
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.

5 participants