Skip to main content

SRE Toolbox

Port Forwarder

Listen on a local TCP port and forward each connection to a remote host and port.

Install

pip install lupaxa-port-forwarder
port-forwarder --help

CLI

port-forwarder 8080 remote.example.com 80
port-forwarder 8080:remote.example.com:80 5432:db.internal:5432
port-forwarder 8080 remote.example.com 80 --bind 0.0.0.0 --allow 10.0.0.0/8
port-forwarder 8080 remote.example.com 80 --max-connections 8 --idle-timeout 60
python -m lupaxa.port_forwarder --version

The tool binds a local TCP listener and relays each accepted client to the remote host and port, copying bytes in both directions until either side closes. Pass one LOCAL HOST REMOTE triple, or one or more LOCAL:HOST:REMOTE mappings. By default it binds 127.0.0.1. Use --bind 0.0.0.0 when other hosts must connect, and --allow to limit who may. --timeout bounds the remote connect. --max-connections and --idle-timeout cap concurrent sessions and quiet ones. The process stays in the foreground and stops with Ctrl+C or SIGTERM.

Library

from lupaxa.port_forwarder import PortForwarder

with PortForwarder(8080, "remote.example.com", 80) as forwarder:
    forwarder.start()

Development

make init
make python-install-dev
make python-check
make mkdocs-serve

Documentation

The published guide is at https://port-forwarder.thelupaxaproject.org/.

Site Markdown lives in mkdocs/.

The Lupaxa Project Footer

Metadata

Release files for lupaxa-port-forwarder 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lupaxa-port-forwarder 0.1.3
File Size Uploaded
lupaxa_port_forwarder-0.1.3.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-port-forwarder 0.1.3
File Interpreter ABI Platform
lupaxa_port_forwarder-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / lupaxa_port_forwarder-0.1.3.tar.gz

Download URL lupaxa_port_forwarder-0.1.3.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
190ab39e24e222c08fc8c354496be78b0839e2f2d5cc7d192e3e9d9ff368a0a4
BLAKE2b-256 checksum
How to use checksums
0cd48d5d40f5acc81dc83c909dad252e144d8309e8c520d399c74baad79089c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / lupaxa_port_forwarder-0.1.3-py3-none-any.whl

Download URL lupaxa_port_forwarder-0.1.3-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24762984062a355fab069db45c036fda3d7aec74381f6688bedc742fb18d720f
BLAKE2b-256 checksum
How to use checksums
ab81292652891cddb892f53f45efeab8ee9f605832c4c7bc655479a6b1f0f77e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page