-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Currently, you must set port number each time either via config or via API.
Every so often that port could be busy, sometimes not, which adds additional cost to error handling and synchronizations. That becomes really complicated with ssmanager and when you add-remove users fast enough.
The proposal is that:
- Allow to bind on port zero, and let the OS find the first free port for you (or fail fast in case if there are no open ports available)
- Return that port number via API:
- Add a new command like
add_dynamic(so as not to break any backward compatibility) - As a response, return the port number:
OK:{"port": 42}
- Add a new command like
Regarding UDP, I see two options here:
- We could try to bind to the same port as TCP, and raise an error if something went wrong.
- Add a flag to the new API command, like
protocol(tcp,tcpudp, etc)
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels