Utility that helps with local TCP ports managment
port-for is a command-line utility and a python library that
helps with local TCP ports management.
It can find an unused TCP localhost port and remember the association::
$ sudo port-for foo
37987
This can be useful when you are installing a stack of software
with multiple parts needing port numbers.
There are several rules port-for is trying to follow to find and
return a new unused port:
1) Port must be unused: port-for checks this by trying to connect
to the port and to bind to it.
2) Port must be IANA unassigned and otherwise not well-known:
this is acheived by maintaining unassigned ports list
(parsed from IANA and Wikipedia).
3) Port shouldn't be inside ephemeral port range.
This is important because ports from ephemeral port range can
be assigned temporary by OS (e.g. by machine's IP stack) and
this may prevent service restart in some circumstances.
``port-for`` doesn't return ports from ephemeral port ranges
configured at the current machine.
4) Other heuristics are also applied: ``port-for`` tries to return
a port from larger port ranges; it also doesn't return ports that are
too close to well-known ports.
- Developed at devel:languages:python
- Sources inherited from project openSUSE:Factory
-
4
derived packages
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout openSUSE:Factory:Rebuild/python-port-for && cd $_
- Create Badge
Source Files
Filename | Size | Changed |
---|---|---|
python-port-for.changes | 0000002683 2.62 KB | |
python-port-for.spec | 0000003228 3.15 KB | |
v0.7.4.tar.gz | 0000022881 22.3 KB |
Latest Revision
- update to 0.7.4: * Dropped support for Python 3.8 (it has reached EOL) * Added Python 3.13 to the supported Python Versions * Update to README's badges * Update to automerge pipeline * Updated black installation to not install on python version older than 3.12
Comments 0