Skip to content

Proxy Configuration Network

Configure network proxy for API access.

Basic Configuration

yaml
proxy:
  enabled: true
  type: http              # http, socks5
  host: 127.0.0.1
  port: 7890

Configuration Options

OptionTypeDefaultDescription
enabledbooleanfalseEnable proxy
typestringhttpProxy type
hoststring127.0.0.1Proxy host
portnumber7890Proxy port
usernamestring-Auth username
passwordstring-Auth password
noProxyarray[]Bypass list

Proxy Types

HTTP Proxy

yaml
proxy:
  enabled: true
  type: http
  host: 127.0.0.1
  port: 7890

SOCKS5 Proxy

yaml
proxy:
  enabled: true
  type: socks5
  host: 127.0.0.1
  port: 1080

With Authentication

yaml
proxy:
  enabled: true
  type: http
  host: proxy.example.com
  port: 8080
  username: user
  password: ${PROXY_PASSWORD}

Bypass List

Domains that should bypass proxy:

yaml
proxy:
  enabled: true
  type: http
  host: 127.0.0.1
  port: 7890
  noProxy:
    - localhost
    - 127.0.0.1
    - api.deepseek.com    # Domestic API

Environment Variables

Alternative to config file:

bash
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
export NO_PROXY=localhost,127.0.0.1

Per-Channel Proxy

yaml
channels:
  - name: openai
    baseUrl: https://api.openai.com/v1
    proxy:
      enabled: true
      host: 127.0.0.1
      port: 7890
      
  - name: deepseek
    baseUrl: https://api.deepseek.com
    proxy:
      enabled: false       # No proxy needed

Testing Proxy

bash
# Test HTTP proxy
curl -x http://127.0.0.1:7890 https://api.openai.com/v1/models

# Test SOCKS5 proxy
curl -x socks5://127.0.0.1:1080 https://api.openai.com/v1/models

Troubleshooting

IssueSolution
Connection timeoutCheck proxy is running
Auth failedVerify username/password
Some requests failCheck noProxy list

Next Steps

Released under the MIT License