Closed antonkomarev closed 4 years ago
You want it to work all the time or only with -f
option?
"random" is not really random, it's like finding the next available port number from well known port numbers such as 8000
for local servers.
Good idea.
I propose to use these common specification: | Scheme | Default | Range |
---|---|---|---|
HTTP |
8000 | 8000-8099 | |
HTTPS |
44300 | 44300-44399 |
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.
@mpyw I've finished this feature. Changed default ports in documentation and tests to 8000
and 43300
. It's not a breaking change because people always were needed to start server with port.
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 :wink:
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: