Skip to main content

Web3 Pi tunnel - a basic tcp reverse tunnel

Project description

WEb3Pi Tunnel

PoC Python implementation of a basic TCP tunnel. Primary purpose: provide a public IP to clients behind NATs.

It was initially developed alongside the Web3Pi Proxy. There are two parts of the tunnel: the server which accepts connections from external users and forwards to the client, and the client which forwards connections further to a target service.

Configure and Run

Setup

Simply install web3pi-tunnel package using your Python package manager, using pip for example:

pip install web3pi-tunnel

Configuration

Create the .env file or set the system environments with the following entries.

Server

  • SERVICE_PUBLIC_IP - the network address of the tunnel server
  • SERVICE_PUBLIC_LISTEN_PORT - the port of tunnel server for external web3 users
  • TUNNEL_ESTABLISH_PORT - the port of the tunnel server for the tunnel client
  • PROXY_ESTABLISH_PORT - the port of the tunnel server for stats
  • TUNNEL_SERVICE_AUTH_KEY - the api key to authenticate the tunnel client, any random character string
  • USE_UPNP - should the tunnel server use UPnP for the service, default value is False, may be set to True, optional

The example of the .env file

SERVICE_PUBLIC_IP=127.0.0.1
SERVICE_PUBLIC_LISTEN_PORT=6512
TUNNEL_ESTABLISH_PORT=7634
PROXY_ESTABLISH_PORT=7835
TUNNEL_SERVICE_AUTH_KEY=aaa

Client

  • TUNNEL_SERVICE_HOST - the network address of the tunnel server
  • CLIENT_SERVICE_HOST - the network address of the client target service
  • CLIENT_SERVICE_PORT - the port of the client target service
  • TUNNEL_ESTABLISH_PORT - the port of the tunnel server
  • TUNNEL_SERVICE_AUTH_KEY - the api key to authenticate the tunnel client, any random character string

The example of the .env file

TUNNEL_SERVICE_HOST=127.0.0.1
CLIENT_SERVICE_HOST=127.0.0.1
CLIENT_SERVICE_PORT=8545
TUNNEL_ESTABLISH_PORT=7634
TUNNEL_SERVICE_AUTH_KEY=aaa

Run

Server

Execute the command

web3pi_tunnel_server

Client

Execute the command

web3pi_tunnel_client

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

web3pi_tunnel-0.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

web3pi_tunnel-0.1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file web3pi_tunnel-0.1.tar.gz.

File metadata

  • Download URL: web3pi_tunnel-0.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-44-generic

File hashes

Hashes for web3pi_tunnel-0.1.tar.gz
Algorithm Hash digest
SHA256 d4884dd1b107c1c6bb3eacf5f10bd024153faf44593ad48bd30414d255b1b41b
MD5 b4f820a7be25d148f901c2fbc9f2b328
BLAKE2b-256 7e9b86e604c2f09479e9d10e0c04f0f35722fb1284d05ebc46cd71e5f9085bc5

See more details on using hashes here.

File details

Details for the file web3pi_tunnel-0.1-py3-none-any.whl.

File metadata

  • Download URL: web3pi_tunnel-0.1-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-44-generic

File hashes

Hashes for web3pi_tunnel-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 35e51804d8afabc98a64b322173a586f0cf471d3e980326235636e72b2128b7f
MD5 9ac162f0a5dad44b66467d9498faa45d
BLAKE2b-256 c242576701e9130d81128e7c273e3c441d3ed837e5ccd5c6338318319da89a31

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