Crates.io | notunnel |
lib.rs | notunnel |
version | 0.1.1 |
created_at | 2025-08-29 14:56:28.486369+00 |
updated_at | 2025-08-29 14:56:28.486369+00 |
description | notunnel is a lightweight port forwarding tool designed for remote development environments. It creates secure tunnels between your local machine and remote development servers, perfect for accessing web services running on remote hosts or within private networks like WireGuard overlays. |
homepage | |
repository | https://git.kjuulh.io/kjuulh/notunnel.git |
max_upload_size | |
id | 1815988 |
size | 141,624 |
notunnel is a lightweight port forwarding tool designed for remote development environments. It creates secure tunnels between your local machine and remote development servers, perfect for accessing web services running on remote hosts or within private networks like WireGuard overlays.
cargo install notunnel
# On your remote development server
notunnel serve
The server will start listening on port 3000 by default.
Create a .env
file on your local machine:
# Local machine configuration
NOTUNNEL_HOST=10.0.9.18 # Your remote server IP
NOTUNNEL_CLIENT_HOST=10.0.9.19 # Your local machine IP (on the same network)
NOTUNNEL_HOST_PORT=3000 # Server port
# Forward remote port 8090 to local port 8090
notunnel open 8090
# Forward remote port 30080 to local port 8090
notunnel open 8090:30080
# Run in background (detached mode)
notunnel open 8090 --detached
Start the notunnel server on your remote development machine:
notunnel serve
Environment variables:
SERVICE_HOST
- Server bind address (default: 0.0.0.0:3000
)NOTUNNEL_HOST
- Server hostname/IP for client connectionsNOTUNNEL_CLIENT_HOST
- Client hostname/IPForward a port from the remote server to your local machine:
# Same port on both sides
notunnel open 8080
# Different ports (local:remote)
notunnel open 3000:8080
# Run in background
notunnel open 8080 --detached
View all currently active port forwards:
notunnel list
Output:
tunnels
- 8080:8080 @ 550e8400-e29b-41d4-a716-446655440000
- 3000:8080 @ 6ba7b810-9dad-11d1-80b4-00c04fd430c8
Stop a specific port forward using its tunnel ID:
notunnel close --tunnel-id 550e8400-e29b-41d4-a716-446655440000
Monitor real-time activity for a specific tunnel:
notunnel tail --tunnel-id 550e8400-e29b-41d4-a716-446655440000
Variable | Description | Default |
---|---|---|
SERVICE_HOST |
Server bind address | 0.0.0.0:3000 |
NOTUNNEL_HOST |
Server hostname/IP | Required |
NOTUNNEL_CLIENT_HOST |
Client hostname/IP | Required |
NOTUNNEL_HOST_PORT |
Server port | Required |
RUST_LOG |
Logging level | info |
Variable | Description | Default |
---|---|---|
NOTUNNEL_HOST |
Remote server hostname/IP | Required |
NOTUNNEL_CLIENT_HOST |
Local client hostname/IP | Required |
NOTUNNEL_HOST_PORT |
Remote server port | Required |
RUST_LOG |
Logging level | info |
# For local testing
RUST_LOG=notmad=trace,notunnel=trace,info
NOTUNNEL_HOST=127.0.0.1
NOTUNNEL_HOST_PORT=3000
# For WireGuard or private network setup
NOTUNNEL_HOST=10.0.9.18
NOTUNNEL_CLIENT_HOST=10.0.9.19
NOTUNNEL_HOST_PORT=3000
When developing web applications on a remote server, notunnel allows you to access the application through your local browser:
# On remote server: Start your web app on port 3000
npm run dev
# On local machine: Forward the port
notunnel open 3000
# Access in browser: http://localhost:3000
Perfect for development environments using WireGuard VPN overlays where services bind to overlay network interfaces:
# Server listens on WireGuard interface (10.0.9.18)
notunnel serve
# Client connects through WireGuard (10.0.9.19)
notunnel open 8080
Run multiple tunnels simultaneously for microservice development:
# Forward multiple services
notunnel open 3000:3000 --detached # Frontend
notunnel open 8080:8080 --detached # Backend API
notunnel open 5432:5432 --detached # PostgreSQL
notunnel open 6379:6379 --detached # Redis
# Check all active tunnels
notunnel list
notunnel uses a client-server architecture with gRPC for communication:
# Clone the repository
git clone https://git.kjuulh.io/kjuulh/notunnel
cd notunnel
# Build the project
cargo build --release
# Run tests
cargo test
notunnel/
├── crates/
│ └── notunnel/
│ ├── proto/ # Protocol buffer definitions
│ ├── src/
│ │ ├── cli/ # CLI command implementations
│ │ ├── grpc/ # gRPC client/server
│ │ ├── tunnels.rs # Tunnel management
│ │ └── main.rs # Entry point
│ └── Cargo.toml
├── remote/ # Remote server configuration
└── README.md
If you cannot connect to the server:
notunnel serve
ping <NOTUNNEL_HOST>
telnet <NOTUNNEL_HOST> 3000
If you get a "port already in use" error:
notunnel list
notunnel close --tunnel-id <ID>
notunnel open 3001:3000
Enable detailed logging for debugging:
export RUST_LOG=notunnel=debug
notunnel open 8080
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
Kasper Juul Hermansen (@kjuulh)