-
Notifications
You must be signed in to change notification settings - Fork 11
Start server on the next unoccupied port #14
Start server on the next unoccupied port #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice feature!
You want it to work all the time or only with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, it would be better that randomly allocating ports only when the port number is omitted.
- no specification ->
localhost:<random unoccupied port>
localhost
->localhost:<random unoccupied port>
localhost:8000
->localhost:8000
or fail
"random" is not really random, it's like finding the next available port number from well known port numbers such as |
Good idea. I propose to use these common specification:
hyper-run -S localhost -s localhost -c ~/cert.pem -t ./public This command will run HTTP proxy on 8000 port and HTTPS proxy on 44300 port by default. If any of them occupied - the port number will be increased within the range. |
c194acf
to
ec93011
Compare
@mpyw I've finished this feature. Changed default ports in documentation and tests to README is more user friendly now. We are showing how to quick start server at the first place, and only then showing full command reference 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Released as v3.1.0 |
This feature is very useful when you are starting multiple servers. If your port is occupied - it will try to start it on the next free port.
@mpyw what do you think?
If you don't like to have this feature enabled by default - we could add option
-f
to enable this feature, like:hyper-run -s localhost:4000 -f -c ~/cert.pem -t ./public