1
0
mirror of https://github.com/6dylan6/jdpro.git synced 2026-05-02 02:36:40 +08:00
This commit is contained in:
dylan
2023-09-26 23:58:18 +08:00
parent 94cd789c68
commit 2761a3da36
+14
View File
@@ -42,8 +42,22 @@ for (let i = 0; i < CookieJDs.length; i++) {
const index = (i + 1 === 1) ? '' : (i + 1);
exports['CookieJD' + index] = CookieJDs[i].trim();
}
let permit = process.env.PERMIT_JS ? process.env.PERMIT_JS.split('&') : '';
if (process.env.DP_POOL) {
if (permit && permit.filter(x => process.mainModule.filename.includes(x)).length != 0) {
try {
require("global-agent/bootstrap");
global.GLOBAL_AGENT.HTTP_PROXY = process.env.DP_POOL;
console.log(`\n---------------使用代理池模式---------------\n`);
} catch {
throw new Error(`请安装global-agent依赖,才能启用代理!`);
}
} else {
}
}
function getIP() {
const https = require('https');
return new Promise((resolve, reject) => {