Merge pull request #152 from ccmuyuu/rainbowcat

Add socks5 username/password
This commit is contained in:
凌莞~(=^▽^=) 2023-11-28 17:05:58 +08:00 committed by GitHub
commit e53df687cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -64,3 +64,6 @@ services:
# 如果需要通过代理联网,那么设置下面两个变量
#- PROXY_IP=
#- PROXY_PORT=
# 代理联网认证,有需要请修改下面两个变量
#- PROXY_USERNAME=
#- PROXY_PASSWORD=

View File

@ -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,