Skip to main content

Remote/Local port forwarding in Python by TCP/UDP

Project description

portfly

A pure Python implementation of SSH Port Forwarding, includes remote forwarding and local forwarding, featured by non-blocking socket, event IO and UDP forwarding path.

Port Forwarding

Remote Port Forwarding:

remote_port_forwarding

Local Port Forwarding:

local_port_forwarding

Installation

$ pip install portfly

Usage

On server side, you need to setup portfly to listen, even udp forwarding path is used:

$ python -m portfly -s server_listen_ip:port

On client side, you control all the details:

# remote forwarding by tcp is the default
$ python -m portfly -c [-x] [--log {INFO|DEBUG} <settings>
# local forwarding by tcp:
$ python -m portfly -c -L <settings>
# local forwarding by udp:
$ python -m portfly -c -L -u <udpport> <settings>
# remote forwarding by udp:
$ python -m portfly -u <udpport> <settings>

The <settings> part is just like ssh, which is:

mapping_port:target_ip:target_port+server_ip:target_port

The extra + can leave the whole parameters unquoted.

Each client process can map only one port to/from server. But server can be connected by many clients simultaneously.

Have Fun... ^____^

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

portfly-0.30.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

portfly-0.30-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file portfly-0.30.tar.gz.

File metadata

  • Download URL: portfly-0.30.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.3

File hashes

Hashes for portfly-0.30.tar.gz
Algorithm Hash digest
SHA256 477a998ae5a9a35a70f1576bae78224c95feef7ab756f530d842d49842bc08f6
MD5 3c0cc148039516acb00f7a795001ea9d
BLAKE2b-256 bdd8b7d4dba8b6559685bf1c50ed89400256882225a0de7676293303a8f05705

See more details on using hashes here.

File details

Details for the file portfly-0.30-py3-none-any.whl.

File metadata

  • Download URL: portfly-0.30-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.3

File hashes

Hashes for portfly-0.30-py3-none-any.whl
Algorithm Hash digest
SHA256 5f8c309f77fa4f5fc22a3148812e1487ffff396d242fb76a091cc29eab624b9e
MD5 ea126c477743caeb81842c3554f793f9
BLAKE2b-256 43ed0a870eab0c2c8748dfeae07315dae49cf0fb01a807f5434160b956498755

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page