Siphon
Secure tunnel client and server for exposing local services through mTLS-authenticated tunnels.
Features
- mTLS Authentication - Certificate-based mutual TLS for secure client-server communication
- HTTP & TCP Tunnels - Support for both HTTP and raw TCP tunnel types
- Cloudflare DNS Integration - Automatic subdomain creation via Cloudflare API (supports Full Strict SSL)
- TUI Dashboard - Real-time metrics and monitoring with terminal UI
- Interactive Setup - Guided wizard for configuration with OS keychain integration
- Cross-Platform - Runs on Linux, macOS, and Windows
Installation
From crates.io
From source
Quick Start
Client Setup
Run the setup wizard to configure server connection:
Then start a tunnel:
Or provide all options directly:
Options:
--local(required): Local address to forward (e.g.,127.0.0.1:3000)--subdomain: Request a specific subdomain (optional, auto-generated if not set)--tunnel-type:http(default) ortcp
Certificates support multiple formats: file path, file://, base64://, op:// (1Password), keychain://.
Server Setup
Configure via environment variables:
# Cloudflare API token - create at https://dash.cloudflare.com/profile/api-tokens
# Required permission: Zone.DNS (Edit)
# Certificates - multiple formats supported:
# Or: base64://LS0tLS1CRUdJTi...
# Or: op://vault/item/field (1Password CLI)
# Or: keychain://service/key (OS keychain)
# DNS target (optional - auto-detects IP if neither is set)
# For VPS with static IP:
# export SIPHON_SERVER_IP="1.2.3.4"
# For platforms like Railway/Render/Fly.io that provide hostnames:
# export SIPHON_SERVER_CNAME="myapp.up.railway.app"
#
# Note: Auto-detection uses outbound requests, which may return the wrong IP
# on some cloud providers. If tunnels don't work, set one of these explicitly.
Or use Docker:
Generating mTLS Certificates
Siphon uses mutual TLS (mTLS) for secure client-server authentication. You need:
- A Certificate Authority (CA)
- A server certificate signed by the CA
- Client certificates signed by the CA
Using OpenSSL
# 1. Create the CA
# 2. Create the server certificate
# 3. Create a client certificate
Configuration
Client
Connection settings are stored in ~/.config/siphon/config.toml:
= "tunnel.example.com:4443"
# Secrets can reference keychain, files, or environment variables
= "keychain://siphon/cert"
= "keychain://siphon/key"
= "keychain://siphon/ca"
Runtime options (--local, --subdomain, --tunnel-type) are provided when starting the tunnel.
Server
See server.example.toml for configuration options.
Cloudflare Full (Strict) SSL
To enable HTTPS on the HTTP data plane (required for Cloudflare Full Strict mode), you have two options:
Option 1: Automatic Origin CA (Recommended)
The server can automatically generate and manage Cloudflare Origin CA certificates:
This requires an additional API token permission: Zone.SSL and Certificates (Edit)
On startup, the server will:
- Revoke any existing Origin CA certificates matching
*.{SIPHON_BASE_DOMAIN}or{SIPHON_BASE_DOMAIN}(other certificates in your zone are not affected) - Generate a new ECDSA key and CSR
- Request a certificate from Cloudflare's Origin CA (valid for 1 year)
- Use it for HTTPS on the HTTP data plane
Option 2: Manual Certificates
Provide your own certificates:
You can use a Cloudflare Origin CA certificate (free, trusted only by Cloudflare) or any valid certificate for your domain.
Utilities
Encode certificates as base64
If you encounter base64 compatibility issues (different CLI tools may produce varying output), you can use the built-in encode command:
# Output: base64://LS0tLS1CRUdJTi...
License
MIT