fix: proxy request
This commit is contained in:
parent
29bbd1df20
commit
af43fc6901
@ -32,6 +32,9 @@ class APIRequest {
|
|||||||
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 proxy = require('proxy-agent');
|
||||||
agent = new proxy(this.client.options.proxy);
|
agent = new proxy(this.client.options.proxy);
|
||||||
|
} else if (this.client.options.http.agent instanceof https.Agent) {
|
||||||
|
agent = this.client.options.http.agent;
|
||||||
|
agent.keepAlive = true;
|
||||||
} else {
|
} else {
|
||||||
agent = new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
|
agent = new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user