Overview
Remote proxy deployment allows you to:- Centralize OAuth tokens - Team shares one authenticated server
- Bypass network restrictions - Route through server with API access
- Reduce client setup - No local binary installation needed
- Monitor usage centrally - Track all requests through proxy
Architecture
Prerequisites
- Linux server with public IP or domain
- Root/sudo access for port binding (80/443)
- CCS CLI installed locally
- Basic understanding of systemd (for persistent service)
Install CLIProxyAPI on Server
SSH into your server and install CCS:Verify installation:Note: Server doesn’t need Claude Code installed, only CCS CLI.
Configure Server-Side Proxy
Create Security: Generate strong random keys:
~/.ccs/config.yaml on server:Authenticate OAuth Providers
On the server, authenticate each provider:Important: Server needs a browser for OAuth flow. Options:
- SSH with X11 forwarding:
ssh -X user@server - Use
--importflag (Kiro only) to copy token from local machine - Temporarily run on desktop, copy
~/.ccs/cliproxy/*.jsonto server
Start Proxy as Systemd Service
Create service file Enable and start:
/etc/systemd/system/ccs-proxy.service:Setup Reverse Proxy (Optional but Recommended)
Use nginx for HTTPS termination:Obtain SSL certificate:
Configuration Reference
Environment Variables
| Variable | Purpose | Example |
|---|---|---|
CCS_PROXY_HOST | Remote hostname | proxy.company.com |
CCS_PROXY_PORT | Remote port | 443 (HTTPS) or 80 (HTTP) |
CCS_PROXY_AUTH_TOKEN | API authentication | base64-encoded-key |
CCS_PROXY_PROTOCOL | Protocol | https or http |
CCS_PROXY_TIMEOUT | Health check timeout | 2000 (ms) |
CCS_PROXY_FALLBACK_ENABLED | Enable fallback | true or false |
CLI Flags
| Flag | Description |
|---|---|
--proxy-host <host> | Override config host |
--proxy-port <port> | Override config port |
--proxy-auth-token <token> | Override config token |
--proxy-protocol <http|https> | Override protocol |
--proxy-timeout <ms> | Health check timeout |
--remote-only | Fail if remote unavailable |
--local-proxy | Force local, skip remote |
--allow-self-signed | Accept self-signed certs |
Config Priority
- CLI flags (highest priority)
- Environment variables
- config.yaml
- Defaults (lowest priority)
Security Best Practices
Authentication
- Rotate keys regularly - Update
api_keyandmanagement_secretquarterly - Use different keys - Separate
auth_tokenandmanagement_key - Limit scope -
api_keyfor queries,management_keyfor admin operations
Network Security
- Use HTTPS - Always in production (self-signed OK for internal networks)
- Firewall rules - Restrict proxy port to known IPs:
- VPN recommended - Route traffic through VPN for extra security
Monitoring
- Log all requests - Enable in config:
- Monitor disk usage - Logs can grow large, rotate with logrotate
- Track quotas - Use
/api/usage/summaryendpoint
Troubleshooting
Connection Refused
Symptom:[X] Proxy error: ECONNREFUSED
Causes:
- Server not running:
sudo systemctl status ccs-proxy - Firewall blocking:
sudo ufw status - Wrong port in config
Authentication Failed
Symptom:[X] Auth error: Invalid token
Causes:
- Token mismatch between client and server
- Token expired (server restarted with new config)
SSL Certificate Errors
Symptom:[X] Network error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
Solutions:
Fallback Not Working
Symptom: Remote fails but local doesn’t start Causes:fallback.enabled: falsein configfallback.auto_start: falseand local binary missing
