tunneltop
A tunnel manager in the familiar top style written with ncurses and asyncio.
Install
pipx install tunneltop
what it is
- a simple tunnel manager written in python that uses the standard library only(standard library only in python 3.11)
- it starts and manages the tunnels for you
- lets the user interactively manage the tunnels as well
- will reload the config file if it receives a
SIGHUP - it is intentionally written as simple and tunnel-agnostic
- may or may not work on windows(let me know if you test it on windows)
toml file
tunneltop expects its config file to be at at $HOME/.tunneltoprc.
You can see an example config file below:
[color]
header_fg = 4
header_bg = 0
active_fg = 23
active_bg = 0
disabled_fg = 8
disabled_bg = 0
timeout_fg = 63
timeout_bg = 0
unknown_fg = 38
unknown_bg = 0
down_fg = 208
down_bg = 0
box_fg = 22
box_bg = 0
[tunnel.socks5ir]
address = "127.0.0.1"
port = 9997
command = "autossh -M 0 -N -D 9997 -o ServerAliveInterval=180 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -l debian -p 22 100.100.100.101"
test_command = 'curl -s -o /dev/null -s -w "%{http_code}" -k -I -4 --socks5 socks5h://127.0.0.1:9997 https://icanhazip.com'
test_command_result = "200"
test_interval = 300
test_timeout = 10
auto_start = false
[tunnel.socks5_3]
address = "127.0.0.1"
port = 9995
command = "autossh -M 0 -N -D 0.0.0.0:9995 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no -o ServerAliveInterval=180 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -l debian -p 2022 100.100.100.100"
test_command = 'curl -s -o /dev/null -s -w "%{http_code}" -k -I -4 --socks5 socks5h://127.0.0.1:9995 https://icanhazip.com'
test_command_result = "200"
test_interval = 300
test_timeout = 10
auto_start = true
The tunnel names must be unique.
address
Displays the address at which the tunnel is available at. It is a display-only option.
port
Displays the port at which the tunnel is available at. It is a display-only option.
command
The command used to start the tunnel.
test_command
The command used to test the state of the tunnel.
test_command_result
The expected result of the test command.
test_interval
How often should the test_command be run.
test_timeout
How long before the test is considered to have timed out.
auto_start
Whether to automatically start this tunnel on startup.
keybindings
j and k move you up and down.
g and Gmove you to the first or last tunnel.
s toggles a tunnel from enabled to disabled or vice versa.
r restarts a tunnel.
t runs the test right now.
pgup and ctrl-b move you up a page.
pgdown and ctrl-f move you down a page.
ctrl-u and ctrl-d move you up and down half a page respectively.
To quit send a SIGINT or a SIGTERM. I'm working on improving this of course.
tunneltop will reload its config file upon receiving a SIGHUP and apply the changes immediately if there are any.
Metadata
Release files for tunneltop 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tunneltop-0.4.6.tar.gz | 22.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tunneltop-0.4.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.7 kB
Release files / tunneltop-0.4.6.tar.gz
| Download URL | tunneltop-0.4.6.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c9bf203390951c1187c64d4f84a88c51b519db4860c8511d97a5312eccd1f18
|
|
BLAKE2b-256 checksum How to use checksums |
e1e39a8cafd6deaefa01bf58fc20437041cf0e391ce06e3c57e82bb97ade56f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.5 Linux/6.12.33_1
|
Release files / tunneltop-0.4.6-py3-none-any.whl
| Download URL | tunneltop-0.4.6-py3-none-any.whl |
|---|---|
| Size | 22.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1d899849c7b1b8ccfadb004a5c636e31aa4442a36b72835ab74170ccee25be4
|
|
BLAKE2b-256 checksum How to use checksums |
743db7af0715181f3fdd1cc417410bf27f51b70958f443c5935f87236f3b8983
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.5 Linux/6.12.33_1
|
Security for tunneltop 0.4.6
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.