API Domain Configuration
rs-tunnel needs to know where your API server is hosted. There are three ways to configure this, in order of precedence:1. Command-Line Flag (Highest Priority)
Specify the API domain for a single command using--domain:
The
--domain flag is Infisical-style: it applies immediately to the current command AND is saved to your local config for future commands.2. Environment Variable
Set a global API domain for all commands in your shell session:Legacy alias:
RS_TUNNEL_API_BASE_URL is also supported for backward compatibility, but RS_TUNNEL_API_URL is recommended.3. Local Configuration File
The CLI stores the API domain in~/.rs-tunnel/config.json:
- When you use the
--domainflag - When you’re prompted interactively on first run
Interactive Configuration
On first run without any configured domain, the CLI prompts you:~/.rs-tunnel/config.json.
Configuration Precedence
When multiple configuration sources exist, rs-tunnel uses this order:--domainflag (command-line argument)RS_TUNNEL_API_URL(environment variable)RS_TUNNEL_API_BASE_URL(legacy environment variable)~/.rs-tunnel/config.json(local file)- Default:
http://localhost:8080
Use
rs-tunnel doctor to see which API URL is currently active.Configuration File Structure
The full~/.rs-tunnel/config.json structure:
~/.rs-tunnel/config.jsonPermissions:
0600 (owner read/write only)
The config file is created automatically by the CLI. You typically don’t need to edit it manually.
Environment Variables
rs-tunnel recognizes these environment variables:Client-Side (CLI)
RS_TUNNEL_API_URL
Purpose: API server base URL
Example:
Default:
Recommended: Use this for all new configurations
Example:
https://api.your-company.comDefault:
http://localhost:8080Recommended: Use this for all new configurations
RS_TUNNEL_API_BASE_URL
Purpose: Legacy alias for
Status: Supported for backward compatibility
Recommendation: Migrate to
RS_TUNNEL_API_URLStatus: Supported for backward compatibility
Recommendation: Migrate to
RS_TUNNEL_API_URLServer-Side (API)
These are configured on the API server, not the CLI:ALLOWED_EMAIL_DOMAIN
Restricts logins to specific email domain
Example:
Example:
@example.comALLOWED_SLACK_TEAM_ID
Restricts logins to specific Slack workspace
Example:
Example:
T01234567MAX_ACTIVE_TUNNELS
Maximum tunnels per user
Default:
Default:
5HEARTBEAT_INTERVAL_SEC
How often CLI sends heartbeats
Default:
Default:
20 secondsCredential Storage
Authentication credentials are stored separately from configuration:With Keytar (Recommended)
If the optionalkeytar dependency is installed:
- Service:
rs-tunnel - Account:
default - Storage: System credential manager (Keychain, Secret Service, Credential Vault)
Fallback Encryption
Withoutkeytar:
- Encrypted data:
~/.rs-tunnel/session.enc(permissions:0600) - Encryption key:
~/.rs-tunnel/session.key(permissions:0600) - Algorithm: AES-256-GCM
Self-Hosted Deployments
For organizations running their own rs-tunnel API:Initial Setup
Team Onboarding
Provide team members with:- API domain URL
- Installation instructions:
After initial configuration, team members won’t need to specify
--domain for subsequent commands.Configuration Directory
The~/.rs-tunnel/ directory contains:
0700 (owner access only)File permissions:
0600 (owner read/write only)
Examples
Development Environment
Production Environment
Switching Between Environments
Persistent Configuration
Verify Configuration
Check which API domain is active:Next Steps
Troubleshooting
Solve common configuration issues
Creating Tunnels
Start using rs-tunnel

