Tunnel through barriers, instantly - expose local services to the internet
Project description
Tunnel through barriers, instantly
Expose localhost to the internet. One command. Zero config.
Open source - Self-hostable - Enterprise security - Free forever
pip install instanton && instanton --port 8000
That's it. You now have a public HTTPS URL. No signup. No config files.
Quick Start - Features - Python SDK - Deployment - Configuration
The Problem
You're building something awesome on localhost:8000. Now you need to:
- Share it with a client
- Test webhooks from Stripe/GitHub
- Demo to your team
- Debug a mobile app
The old way: Port forwarding, firewall rules, dynamic DNS, SSL certificates, nginx configs...
The Instanton way:
instanton --port 8000
Instanton v1.0.0
Tunnel established!
Public URL: https://abc123.instanton.tech
Forwarding: https://abc123.instanton.tech -> http://localhost:8000
Press Ctrl+C to stop
Quick Start
Installation
pip install instanton
HTTP Tunnel
# Basic - expose port 8000
instanton --port 8000
# Custom subdomain
instanton --port 8000 --subdomain myapp
# With traffic inspector
instanton --port 8000 --inspect
TCP Tunnel (Databases, SSH)
# PostgreSQL
instanton tcp 5432
# MySQL
instanton tcp 3306
# SSH
instanton tcp 22
UDP Tunnel (Gaming, VoIP, DNS)
# Game server
instanton udp 27015
# DNS
instanton udp 53
Python SDK
import instanton
# Async context manager
async with instanton.forward(8000) as tunnel:
print(f"Public URL: {tunnel.url}")
# Your app is now accessible at tunnel.url
await your_app.run()
# Sync API
tunnel = instanton.forward_sync(8000)
print(tunnel.url)
Long-Running APIs (AI, Streaming)
# No timeout - perfect for AI inference, video streaming
instanton --port 8000 --no-request-timeout
Features
Performance
|
Security
|
Observability
|
Load Balancing9 algorithms:
|
Protocols
|
Developer Experience
|
Scalability
Instanton is designed to handle thousands of concurrent users:
- Unique subdomain generation: 12-character hex subdomains with 48 bits of entropy
- Probability of collision for 10,000 tunnels: < 0.00002%
- Efficient port allocation: TCP (10000-19999), UDP (20000-29999)
- Fast tunnel lookups: O(1) dictionary operations
- Memory efficient: Minimal per-connection overhead
Zero Trust Security
flowchart LR
subgraph ZeroTrust["ZERO TRUST ARCHITECTURE"]
direction LR
A["🔐 Identity<br/>Verify"] --> B["💻 Device<br/>Posture"]
B --> C["⚠️ Risk<br/>Score"]
C --> D["✅ Access<br/>Decision"]
end
flowchart TB
subgraph TrustLevels["Trust Levels & Access Rights"]
direction LR
U["UNTRUSTED"] --> L["LOW"]
L --> M["MEDIUM"]
M --> H["HIGH"]
H --> V["VERIFIED"]
end
U -.-> UB["🚫 Block"]
L -.-> LA["Limited Access"]
M -.-> SA["Standard Access"]
H -.-> EA["Extended Access"]
V -.-> FA["✅ Full Access"]
|
TLS 1.3 ECDHE + AES-GCM ChaCha20-Poly1305 Certificate pinning Perfect forward secrecy |
DDoS Protection Rate limiting (3 algorithms) Bot detection IP reputation scoring Geo-blocking Slowloris mitigation |
Authentication JWT (HS256, RS256) OAuth2 / OIDC mTLS certificates API keys (Argon2) Basic auth |
Architecture
flowchart LR
subgraph Client["🖥️ Client"]
direction TB
C1["Local Service<br/>localhost:8000"]
end
subgraph Features["⚡ Optimizations"]
direction TB
F1["LZ4 Compression"]
F2["Connection Pool"]
F3["Zero-copy Buffers"]
F4["uvloop (Linux)"]
end
subgraph Relay["🌐 Relay Server"]
direction TB
R1["TLS Termination"]
R2["Subdomain Routing"]
R3["Load Balancing"]
end
subgraph Internet["🌍 Internet"]
direction TB
I1["Public Users<br/>abc123.instanton.tech"]
end
C1 <-->|"QUIC/HTTP3<br/>(0-RTT, multiplexed)"| Relay
Relay <-->|"HTTPS<br/>(pooled)"| Internet
Features -.-> C1
Deployment
Docker
# Run the relay server
docker run -d \
--name instanton-server \
-p 443:443 \
-p 4443:4443 \
-e INSTANTON_DOMAIN=tunnel.example.com \
-v ./certs:/app/certs:ro \
ghcr.io/drruin/instanton-server:latest
Docker Compose
version: '3.8'
services:
instanton:
image: ghcr.io/drruin/instanton-server:latest
ports:
- "443:443"
- "4443:4443"
environment:
- INSTANTON_DOMAIN=tunnel.example.com
volumes:
- ./certs:/app/certs:ro
command:
- instanton-server
- --domain
- tunnel.example.com
- --cert
- /app/certs/cert.pem
- --key
- /app/certs/key.pem
restart: unless-stopped
Kubernetes (Helm)
# Add the Helm repository
helm repo add instanton https://drruin.github.io/instanton
helm repo update
# Install
helm install instanton instanton/instanton-server \
--set domain=tunnel.example.com \
--set ingress.enabled=true
Configuration
CLI Options
instanton --help
Options:
--port INTEGER Local port to expose [required]
--subdomain TEXT Request specific subdomain
--server TEXT Relay server address
--auth-token TEXT Authentication token
--timeout INTEGER Connection timeout (seconds) [default: 30]
--idle-timeout INTEGER Idle timeout (seconds) [default: 300]
--no-request-timeout Disable request timeout (for long-running APIs)
--inspect Enable traffic inspector at localhost:4040
--quic / --no-quic Use QUIC transport [default: enabled]
--verbose Enable verbose logging
--version Show version
--help Show this message
Environment Variables
export INSTANTON_SERVER=relay.example.com
export INSTANTON_AUTH_TOKEN=your-token
export INSTANTON_DOMAIN=tunnel.example.com
export INSTANTON_LOG_LEVEL=info
Config File (instanton.yaml)
server: relay.example.com
auth_token: ${INSTANTON_AUTH_TOKEN}
tunnels:
web:
port: 8000
subdomain: myapp
api:
port: 3000
subdomain: api
no_request_timeout: true
db:
type: tcp
port: 5432
Error Handling
Instanton provides clear, actionable error messages:
flowchart TB
subgraph ErrorBox["⚠️ Error: CONNECTION_TIMEOUT"]
direction TB
E1["Connection to instanton.tech timed out after 30.0s."]
E2["Please check your network connection and server address."]
end
style ErrorBox fill:#fee2e2,stroke:#dc2626,color:#991b1b
Common error codes:
CONNECTION_TIMEOUT- Server not reachableSUBDOMAIN_TAKEN- Requested subdomain in useSERVER_FULL- Server at capacityLOCAL_SERVICE_ERROR- Local service not running
Testing
# Clone the repository
git clone https://github.com/DrRuin/instanton.git
cd instanton
# Install development dependencies
pip install -e ".[dev]"
# Run all tests (1258+)
pytest tests/ -v
# Run with coverage
pytest tests/ -v --cov=instanton --cov-report=html
# Run specific test categories
pytest tests/test_protocol.py -v
pytest tests/test_scalability.py -v
pytest tests/test_exceptions.py -v
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Fork and clone
git clone https://github.com/YOUR_USERNAME/instanton.git
cd instanton
# Create a branch
git checkout -b feature/amazing-feature
# Make your changes, then test
pytest tests/ -v
ruff check src/
ruff format src/
# Commit and push
git commit -m "Add amazing feature"
git push origin feature/amazing-feature
# Open a Pull Request
Roadmap
- HTTP/HTTPS tunnels
- TCP/UDP tunnels
- QUIC/HTTP3 transport
- Zero Trust security
- 9 load balancing algorithms
- DDoS protection
- Traffic inspector
- Prometheus metrics
- OpenTelemetry tracing
- Docker & Kubernetes
- Helm charts
- Python SDK
- Comprehensive error handling
- SAML authentication
- Web dashboard
- Terraform provider
- VS Code extension
License
MIT License - see LICENSE for details.
Life's too short for port forwarding and firewall configs.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instanton-0.6.5.tar.gz.
File metadata
- Download URL: instanton-0.6.5.tar.gz
- Upload date:
- Size: 749.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
073f04361f5d6359e081f6cf2b1c9417ef78cda34ac0fcd174a41cfea43e16c8
|
|
| MD5 |
3250fe468ff23abb3519d844959a725a
|
|
| BLAKE2b-256 |
1e51aea9545fe0e3448bc76883bcdd42f051584d2fab2f82f31bfb274c707b18
|
Provenance
The following attestation bundles were made for instanton-0.6.5.tar.gz:
Publisher:
release.yml on DrRuin/instanton
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instanton-0.6.5.tar.gz -
Subject digest:
073f04361f5d6359e081f6cf2b1c9417ef78cda34ac0fcd174a41cfea43e16c8 - Sigstore transparency entry: 813408834
- Sigstore integration time:
-
Permalink:
DrRuin/instanton@52b3076d4a8bccfdd95547562238c102f775960f -
Branch / Tag:
refs/tags/v0.6.5 - Owner: https://github.com/DrRuin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@52b3076d4a8bccfdd95547562238c102f775960f -
Trigger Event:
release
-
Statement type:
File details
Details for the file instanton-0.6.5-py3-none-any.whl.
File metadata
- Download URL: instanton-0.6.5-py3-none-any.whl
- Upload date:
- Size: 261.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
213642b9dadd27d8d3a87abcdf2261dfb2f6f9123ade0a2e8f71b5191efffdd9
|
|
| MD5 |
d9e70049e14fa8f01f249b9b8d01e524
|
|
| BLAKE2b-256 |
7b0692c9462d67ead2bdd840287a94bd5077ecc91c06c419a54cba99f3312ca0
|
Provenance
The following attestation bundles were made for instanton-0.6.5-py3-none-any.whl:
Publisher:
release.yml on DrRuin/instanton
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instanton-0.6.5-py3-none-any.whl -
Subject digest:
213642b9dadd27d8d3a87abcdf2261dfb2f6f9123ade0a2e8f71b5191efffdd9 - Sigstore transparency entry: 813408835
- Sigstore integration time:
-
Permalink:
DrRuin/instanton@52b3076d4a8bccfdd95547562238c102f775960f -
Branch / Tag:
refs/tags/v0.6.5 - Owner: https://github.com/DrRuin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@52b3076d4a8bccfdd95547562238c102f775960f -
Trigger Event:
release
-
Statement type: