Skip to main content

Overview

By default, CCS runs CLIProxyAPI as a local binary on your machine. With Remote Proxy, you can connect to a CLIProxyAPI server running on a different machine—Docker container, Kubernetes pod, or dedicated server. Use cases:
  • Run CLIProxyAPI on a powerful server while working from a laptop
  • Share a single CLIProxyAPI instance across multiple machines
  • Deploy CLIProxyAPI in Docker/Kubernetes for team use
  • Reduce local resource usage

Configuration Methods

CCS supports three ways to configure remote proxy, with the following priority:

Skip Local OAuth

When connecting to a remote proxy with authentication, you can skip local OAuth entirely. This is useful when the remote server already has authenticated tokens. How it works:
  • If --proxy-auth-token is provided, CCS skips local OAuth flow
  • The remote server handles all authentication
  • No local token storage needed
Use cases:
  • Shared team proxy with centralized auth
  • CI/CD pipelines using pre-authenticated remote proxy
  • Docker/Kubernetes deployments with service tokens
Example:
Configuration:

Dashboard Configuration

The easiest way to configure remote proxy is via the web dashboard:
  1. Run ccs config to open the dashboard
  2. Navigate to Settings → Proxy tab
  3. Select Remote mode
  4. Enter your remote server details:
    • Host: Server hostname or IP address
    • Port: CLIProxyAPI port (default: 8317)
    • Protocol: HTTP or HTTPS
    • Auth Token: Optional authentication token
    • Backend: Select CLIProxy backend (original/plus)
  5. Click Test Connection to verify connectivity
  6. Configure fallback options as needed
Remote Proxy Settings
Available since v7.37.0 - Backend switching allows choosing between original CLIProxyAPI and CLIProxyAPIPlus backends.

Backend Selection

Available Backends:
  • original - Standard CLIProxyAPI (default)
  • plus - CCS-maintained CLIProxyAPIPlus community fork for plus-only providers
Configuration:
Dashboard dropdown provides visual selection with auto-detection of available backends.

HTTPS Tunnel

When using --proxy-protocol https, CCS automatically starts a local HTTP→HTTPS tunnel that forwards requests to the remote HTTPS server. This is required because Claude Code’s HTTP client (undici) doesn’t support HTTPS in ANTHROPIC_BASE_URL. Architecture Flow:
Key Features:
  • Automatic activation - No manual flag needed, activates when protocol=https
  • Self-signed certificate support - Use --allow-self-signed for dev/test environments
  • Transparent streaming - No buffering, preserves real-time streaming
  • Authorization injection - Auth token automatically added to outbound HTTPS requests
  • No SSL configuration - Tunnel handles all HTTPS complexity internally
Example:
Technical Details:
  • Tunnel binds to random available port on localhost
  • Only Claude Code can access the tunnel (127.0.0.1)
  • Tunnel terminates when CCS session ends
  • No manual SSL certificate installation required

Config File

Add the cliproxy_server section to ~/.ccs/config.yaml:

Configuration Options


CLI Flags

Override configuration for a single command:

Available Flags


Environment Variables

For CI/CD pipelines and automation:

Available Variables


Docker Deployment

Run CLIProxyAPI in a Docker container:

Kubernetes Deployment

Deploy CLIProxyAPI as a Kubernetes service:
Access from your local machine:

Fallback Behavior

When remote proxy is enabled but unreachable:
  1. With fallback enabled (default):
    • CCS prompts: “Remote proxy unreachable. Start local proxy? [Y/n]”
    • If auto-start enabled, starts local proxy automatically
    • Continues with local proxy
  2. With --remote-only flag:
    • CCS fails immediately with error message
    • No fallback, no prompt
  3. In non-interactive mode (no TTY):
    • Falls back to local if fallback.enabled: true
    • Fails if fallback disabled or auto-start disabled

Troubleshooting

Error: Remote proxy unreachable: Connection refusedSolutions:
  • Verify the remote server is running: curl http://HOST:PORT/health
  • Check firewall rules allow port 8317
  • Ensure correct host/port configuration
Error: Remote proxy unreachable: Authentication failedSolutions:
  • Verify auth token matches server configuration
  • Check token is correctly set (no extra spaces/quotes)
  • Ensure server requires authentication
Error: Remote proxy unreachable: TimeoutSolutions:
  • Check network connectivity to remote host
  • Verify no proxy/VPN blocking the connection
  • Increase timeout in config if needed
Warning: When using HTTPS with self-signed certificatesCCS automatically allows self-signed certificates when protocol is https. A warning is displayed in verbose mode.

Security Considerations

When exposing CLIProxyAPI to the network:
  • Always use authentication tokens in production
  • Consider HTTPS for encrypted connections
  • Restrict access via firewall rules
  • Use private networks when possible
Best practices:
  • Use --proxy-auth-token for authenticated access
  • Deploy behind a reverse proxy (nginx, Caddy) for HTTPS
  • Limit network access to trusted IPs
  • Rotate auth tokens periodically