diff --git a/docker-compose.yaml b/docker-compose.yaml index fcc1be5..ed3ce01 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -64,3 +64,6 @@ services: # 如果需要通过代理联网,那么设置下面两个变量 #- PROXY_IP= #- PROXY_PORT= + # 代理联网认证,有需要请修改下面两个变量 + #- PROXY_USERNAME= + #- PROXY_PASSWORD= diff --git a/src/client/Telegram.ts b/src/client/Telegram.ts index 8d029a8..c153ed0 100644 --- a/src/client/Telegram.ts +++ b/src/client/Telegram.ts @@ -53,6 +53,8 @@ export default class Telegram { socksType: 5, ip: process.env.PROXY_IP, port: parseInt(process.env.PROXY_PORT), + ...(process.env.PROXY_USERNAME && { username: process.env.PROXY_USERNAME }), + ...(process.env.PROXY_PASSWORD && { password: process.env.PROXY_PASSWORD }), } : undefined, autoReconnect: true, networkSocket: process.env.TG_CONNECTION === 'websocket' ? PromisedWebSockets : PromisedNetSockets,