mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-23 15:50:07 +08:00
Fix TG_PROXY_AUTH handling in notify.js to match notify.py logic
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
7412a201f4
commit
82ce0173a8
|
|
@ -482,9 +482,13 @@ function tgBotNotify(text, desp) {
|
||||||
timeout,
|
timeout,
|
||||||
};
|
};
|
||||||
if (TG_PROXY_HOST && TG_PROXY_PORT) {
|
if (TG_PROXY_HOST && TG_PROXY_PORT) {
|
||||||
|
let proxyHost = TG_PROXY_HOST;
|
||||||
|
if (TG_PROXY_AUTH && !TG_PROXY_HOST.includes('@')) {
|
||||||
|
proxyHost = `${TG_PROXY_AUTH}@${TG_PROXY_HOST}`;
|
||||||
|
}
|
||||||
let agent;
|
let agent;
|
||||||
agent = new ProxyAgent({
|
agent = new ProxyAgent({
|
||||||
uri: `http://${TG_PROXY_AUTH}${TG_PROXY_HOST}:${TG_PROXY_PORT}`,
|
uri: `http://${proxyHost}:${TG_PROXY_PORT}`,
|
||||||
});
|
});
|
||||||
options.dispatcher = agent;
|
options.dispatcher = agent;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user