mirror of
https://github.com/6dylan6/jdpro.git
synced 2026-05-02 02:36:40 +08:00
1
This commit is contained in:
+14
@@ -42,8 +42,22 @@ for (let i = 0; i < CookieJDs.length; i++) {
|
|||||||
const index = (i + 1 === 1) ? '' : (i + 1);
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
exports['CookieJD' + index] = CookieJDs[i].trim();
|
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() {
|
function getIP() {
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user