Update APIRequest.js
Fix proxy-agent to version 5
This commit is contained in:
parent
48ebad7a1f
commit
cca7d2ce66
@ -35,8 +35,8 @@ class APIRequest {
|
|||||||
make(captchaKey = undefined, captchaRqtoken = undefined) {
|
make(captchaKey = undefined, captchaRqtoken = undefined) {
|
||||||
if (agent === null) {
|
if (agent === null) {
|
||||||
if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) {
|
if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) {
|
||||||
const proxy = require('proxy-agent');
|
const ProxyAgent = require('proxy-agent');
|
||||||
agent = new proxy.ProxyAgent(this.client.options.proxy);
|
agent = new ProxyAgent(this.client.options.proxy);
|
||||||
} else if (this.client.options.http.agent instanceof https.Agent) {
|
} else if (this.client.options.http.agent instanceof https.Agent) {
|
||||||
agent = this.client.options.http.agent;
|
agent = this.client.options.http.agent;
|
||||||
agent.keepAlive = true;
|
agent.keepAlive = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user