feat: support outbound proxy for Chromium sessions (#131)

* feat: support outbound proxy for Chromium sessions

Routes WhatsApp Web traffic through an HTTP/HTTPS/SOCKS5 proxy when
PROXY_URL is set. Optional PROXY_API_KEY enables auth by passing the
key as the basic-auth username (the format API-key proxies expect).
No behavior change when unset.

Useful for deployments behind egress filters or where outbound
WhatsApp traffic must originate from a specific IP.

* docs: 📝 rewrite proxy auth part

* fix: 🐛 move api key value to passwd

* fix: 💄 change var naming

* fix: 🎨 change var ref in docs and data passing
This commit is contained in:
vbas-644 2026-05-27 12:56:34 +03:00 • committed by GitHub
commit 132bcf6ee3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 4 deletions

View file

@ -13,6 +13,16 @@ services:
env_file: .env
volumes:
- ./sessions:/usr/src/app/sessions
# Optional: route Chromium (WhatsApp Web) traffic through an outbound proxy.
# Set PROXY_URL (and optionally PROXY_USERNAME / PROXY_PASSWORD for HTTP
# Basic auth) in .env, or uncomment the block below to point at the
# bundled tinyproxy service.
# environment:
# PROXY_URL: http://tinyproxy:8888
# # PROXY_USERNAME: api-key
# # PROXY_PASSWORD: your-api-key
# depends_on:
# - tinyproxy
# Optional healthcheck
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
@ -20,3 +30,17 @@ services:
# timeout: 10s
# retries: 3
# start_period: 40s
# Optional: local HTTP proxy for testing the PROXY_URL feature end-to-end.
# Uncomment along with the api `environment` / `depends_on` blocks above.
# tinyproxy:
# image: vimagick/tinyproxy
# container_name: wwebjs-tinyproxy
# ports:
# - "8888:8888"
# environment:
# ALLOWED_NETWORKS: 0.0.0.0/0
# # Uncomment to test the PROXY_USERNAME / PROXY_PASSWORD path.
# # BASIC_AUTH_USER: "api-key"
# # BASIC_AUTH_PASSWORD: "your-api-key"
# restart: unless-stopped