| Crates.io | siphon-server |
| lib.rs | siphon-server |
| version | 0.1.1 |
| created_at | 2025-12-26 09:11:06.917976+00 |
| updated_at | 2025-12-27 00:21:37.929166+00 |
| description | Siphon tunnel server with Cloudflare DNS integration |
| homepage | |
| repository | https://github.com/remikalbe/siphon |
| max_upload_size | |
| id | 2005440 |
| size | 156,094 |
Secure tunnel client and server for exposing local services through mTLS-authenticated tunnels.
cargo install siphon # Client
cargo install siphon-server # Server
git clone https://github.com/RemiKalbe/siphon.git
cd siphon
cargo build --release
Run the setup wizard to configure server connection:
siphon setup
Then start a tunnel:
siphon --local 127.0.0.1:3000
Or provide all options directly:
siphon --server tunnel.example.com:4443 \
--local 127.0.0.1:3000 \
--cert ./client.crt \
--key ./client.key \
--ca ./ca.crt
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) or tcpCertificates support multiple formats: file path, file://, base64://, op:// (1Password), keychain://.
Configure via environment variables:
export SIPHON_BASE_DOMAIN="tunnel.example.com"
export SIPHON_CLOUDFLARE_ZONE_ID="your-zone-id"
# Cloudflare API token - create at https://dash.cloudflare.com/profile/api-tokens
# Required permission: Zone.DNS (Edit)
export SIPHON_CLOUDFLARE_API_TOKEN="your-token"
# Certificates - multiple formats supported:
export SIPHON_CERT="file:///path/to/server.crt"
export SIPHON_KEY="file:///path/to/server.key"
export SIPHON_CA_CERT="file:///path/to/ca.crt"
# 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.
siphon-server
Or use Docker:
docker-compose up -d
Siphon uses mutual TLS (mTLS) for secure client-server authentication. You need:
# 1. Create the CA
openssl genrsa -out ca.key 4096
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt \
-subj "/CN=Siphon CA"
# 2. Create the server certificate
openssl genrsa -out server.key 4096
openssl req -new -key server.key -out server.csr \
-subj "/CN=tunnel.example.com"
openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key \
-CAcreateserial -out server.crt
# 3. Create a client certificate
openssl genrsa -out client.key 4096
openssl req -new -key client.key -out client.csr \
-subj "/CN=client1"
openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key \
-CAcreateserial -out client.crt
Connection settings are stored in ~/.config/siphon/config.toml:
server_addr = "tunnel.example.com:4443"
# Secrets can reference keychain, files, or environment variables
cert = "keychain://siphon/cert"
key = "keychain://siphon/key"
ca_cert = "keychain://siphon/ca"
Runtime options (--local, --subdomain, --tunnel-type) are provided when starting the tunnel.
See server.example.toml for configuration options.
To enable HTTPS on the HTTP data plane (required for Cloudflare Full Strict mode), you have two options:
The server can automatically generate and manage Cloudflare Origin CA certificates:
export SIPHON_CLOUDFLARE_AUTO_ORIGIN_CA="true"
This requires an additional API token permission: Zone.SSL and Certificates (Edit)
On startup, the server will:
*.{SIPHON_BASE_DOMAIN} or {SIPHON_BASE_DOMAIN} (other certificates in your zone are not affected)Provide your own certificates:
export SIPHON_HTTP_CERT="file:///path/to/origin.crt"
export SIPHON_HTTP_KEY="file:///path/to/origin.key"
You can use a Cloudflare Origin CA certificate (free, trusted only by Cloudflare) or any valid certificate for your domain.
If you encounter base64 compatibility issues (different CLI tools may produce varying output), you can use the built-in encode command:
siphon encode /path/to/server.crt
# Output: base64://LS0tLS1CRUdJTi...
MIT