Skip to main content

Remote/Local port forwarding in Python by TCP/UDP

Project description

portfly

A 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 for udp forwarding path:

$ 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.

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.31.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

portfly-0.31-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for portfly-0.31.tar.gz
Algorithm Hash digest
SHA256 e53dad31e4e6667ea054f2d5662313f06a856a101226501cd5ff380c08628007
MD5 73883971afc4793b52022fc82cf5a9d8
BLAKE2b-256 c6b0f1735207515a5dff70b45aa70e6a371bf9b9460dc97559f44087803c234d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: portfly-0.31-py3-none-any.whl
  • Upload date:
  • Size: 10.1 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.31-py3-none-any.whl
Algorithm Hash digest
SHA256 a06b1b7f0d72e7fafda7b134cac22b5923b31fb659e91d3d462d45929bb1c6a9
MD5 c2cf7deb855fc7a1c044f1001a982765
BLAKE2b-256 699b2cde751095b9553c03062b32b708c7115566982d56c9a2256569762a2427

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