Proxy Configuration
agent-wechat can route all container traffic through a transparent proxy. This is useful when WeChat needs to connect through a specific network path.
Setting up a proxy
Via the CLI
# HTTP proxywx up --proxy user:pass@host:port
# SOCKS5 proxywx up --proxy socks5://user:pass@host:portVia Docker Compose
Set the PROXY environment variable:
environment: - PROXY=user:pass@host:portOr pass it on the command line:
PROXY=user:pass@host:port docker compose up -dHow it works
The container uses redsocks + iptables to set up a transparent proxy. All outgoing TCP connections from inside the container are routed through the proxy — this is invisible to WeChat, which thinks it’s connecting directly.
This requires the NET_ADMIN capability in your Docker configuration:
cap_add: - NET_ADMINProxy formats
| Format | Example |
|---|---|
| HTTP with auth | user:pass@proxy.example.com:8080 |
| HTTP without auth | proxy.example.com:8080 |
| SOCKS5 with auth | socks5://user:pass@proxy.example.com:1080 |
| SOCKS5 without auth | socks5://proxy.example.com:1080 |
Changing the proxy
To change the proxy, stop and restart the container with the new value:
wx downwx up --proxy new-proxy:portOr update the PROXY environment variable and recreate:
docker compose downPROXY=new-proxy:port docker compose up -d