From cca7d2ce661a07f9bf32bf8a97d009bcce455d02 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Thu, 30 Nov 2023 14:11:13 +0200 Subject: [PATCH] Update APIRequest.js Fix proxy-agent to version 5 --- src/rest/APIRequest.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rest/APIRequest.js b/src/rest/APIRequest.js index 6659841..a75e722 100644 --- a/src/rest/APIRequest.js +++ b/src/rest/APIRequest.js @@ -35,8 +35,8 @@ class APIRequest { make(captchaKey = undefined, captchaRqtoken = undefined) { if (agent === null) { if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) { - const proxy = require('proxy-agent'); - agent = new proxy.ProxyAgent(this.client.options.proxy); + const ProxyAgent = require('proxy-agent'); + agent = new ProxyAgent(this.client.options.proxy); } else if (this.client.options.http.agent instanceof https.Agent) { agent = this.client.options.http.agent; agent.keepAlive = true;