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 serverSERVICE_PUBLIC_LISTEN_PORT
- the port of tunnel server for external web3 usersTUNNEL_ESTABLISH_PORT
- the port of the tunnel server for the tunnel clientPROXY_ESTABLISH_PORT
- the port of the tunnel server for statsTUNNEL_SERVICE_AUTH_KEY
- the api key to authenticate the tunnel client, any random character stringUSE_UPNP
- should the tunnel server use UPnP for the service, default value isFalse
, may be set toTrue
, 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 serverCLIENT_SERVICE_HOST
- the network address of the client target serviceCLIENT_SERVICE_PORT
- the port of the client target serviceTUNNEL_ESTABLISH_PORT
- the port of the tunnel serverTUNNEL_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for web3pi_tunnel-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35e51804d8afabc98a64b322173a586f0cf471d3e980326235636e72b2128b7f |
|
MD5 | 9ac162f0a5dad44b66467d9498faa45d |
|
BLAKE2b-256 | c242576701e9130d81128e7c273e3c441d3ed837e5ccd5c6338318319da89a31 |