@whyour/qinglong 2.18.2-0 → 2.18.2-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sample/notify.js +5 -5
package/package.json
CHANGED
package/sample/notify.js
CHANGED
|
@@ -428,7 +428,7 @@ function tgBotNotify(text, desp) {
|
|
|
428
428
|
TG_PROXY_AUTH,
|
|
429
429
|
} = push_config;
|
|
430
430
|
if (TG_BOT_TOKEN && TG_USER_ID) {
|
|
431
|
-
|
|
431
|
+
let options = {
|
|
432
432
|
url: `${TG_API_HOST}/bot${TG_BOT_TOKEN}/sendMessage`,
|
|
433
433
|
json: {
|
|
434
434
|
chat_id: `${TG_USER_ID}`,
|
|
@@ -442,20 +442,20 @@ function tgBotNotify(text, desp) {
|
|
|
442
442
|
};
|
|
443
443
|
if (TG_PROXY_HOST && TG_PROXY_PORT) {
|
|
444
444
|
const { HttpProxyAgent, HttpsProxyAgent } = require('hpagent');
|
|
445
|
-
const
|
|
445
|
+
const _options = {
|
|
446
446
|
keepAlive: true,
|
|
447
447
|
keepAliveMsecs: 1000,
|
|
448
448
|
maxSockets: 256,
|
|
449
449
|
maxFreeSockets: 256,
|
|
450
450
|
proxy: `http://${TG_PROXY_AUTH}${TG_PROXY_HOST}:${TG_PROXY_PORT}`,
|
|
451
451
|
};
|
|
452
|
-
const httpAgent = new HttpProxyAgent(
|
|
453
|
-
const httpsAgent = new HttpsProxyAgent(
|
|
452
|
+
const httpAgent = new HttpProxyAgent(_options);
|
|
453
|
+
const httpsAgent = new HttpsProxyAgent(_options);
|
|
454
454
|
const agent = {
|
|
455
455
|
http: httpAgent,
|
|
456
456
|
https: httpsAgent,
|
|
457
457
|
};
|
|
458
|
-
|
|
458
|
+
options.agent = agent;
|
|
459
459
|
}
|
|
460
460
|
$.post(options, (err, resp, data) => {
|
|
461
461
|
try {
|