Package Info

python-port-for


Utility that helps with local TCP ports managment


Development/Languages/Python

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.


License: MIT
URL: https://github.com/kmike/port-for/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.4-bp155.2.12 info GA Release 2023-05-22 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-port-for
0.4-bp154.1.21 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-port-for
0.4-bp153.1.16 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-port-for
  • python3-port-for
0.4-bp152.1.10 info GA Release 2020-04-17 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-port-for
  • python3-port-for