Utility that helps with local TCP ports managment

Edit Package python-port-for

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.

Refresh
Refresh
Source Files
Filename Size Changed
python-port-for.changes 0000002081 2.03 KB
python-port-for.spec 0000003227 3.15 KB
v0.7.2.tar.gz 0000023126 22.6 KB
Revision 3 (latest revision is 5)
Dominique Leuenberger's avatar Dominique Leuenberger (dimstar_suse) accepted request 1137438 from Dirk Mueller's avatar Dirk Mueller (dirkmueller) (revision 3)
- update to 0.7.2:
  * Drop support for python 3.7
  * Support Python 3.12
  * #152, #166, #170
  * Add PortType type alias for easier typing related code
  * get_port will now allow passing additional exclude_ports
    parameter - these ports will not be chosen.
  * Add python 3.11 to the list of supported python versions.
  * Use towncrier as a changelog management tool.
  * Moved development dependencies to be managed by pipenv. All
    development process can be managed  with it - which means
    automatic isolation.
  * Migrate versioning tool to tbump, and move package definition
    to pyproject.toml
  * Moved as much of the setup.cfg settings into the
    pyproject.toml as possible. Dropped pydocstyle support.
Comments 0
openSUSE Build Service is sponsored by