random_port function

Select a random safe port

Select a random safe port

This is a small utility function to get random safe ports to run your application on. It chooses a port within the range that cannot be registeret to IANA and thus is safe to assume are not in use.

random_port()

Returns

An integer in the range 49152-65535

Examples

random_port()
  • Maintainer: Thomas Lin Pedersen
  • License: MIT + file LICENSE
  • Last published: 2024-02-05