fix: proxy error

This commit is contained in:
Elysia
2024-07-22 21:29:16 +07:00
parent c8a617bd40
commit bbbf40c5ac
2 changed files with 6 additions and 3 deletions

View File

@@ -3,7 +3,11 @@
const Discord = require('../src/index'); const Discord = require('../src/index');
const { ProxyAgent } = require('proxy-agent'); const { ProxyAgent } = require('proxy-agent');
const proxy = new ProxyAgent('<proxy>'); const proxy = new ProxyAgent({
getProxyForUrl: function () {
return '<any proxy>';
},
});
const client = new Discord.Client({ const client = new Discord.Client({
ws: { ws: {

View File

@@ -48,8 +48,7 @@ class APIRequest {
secureProtocol: 'TLSv1_2_method', secureProtocol: 'TLSv1_2_method',
ciphers: ciphers.join(':'), ciphers: ciphers.join(':'),
})) { })) {
this.client.options.http.agent.options[k] = v; this.client.options.http.agent.httpsAgent[k] = v;
this.client.options.http.agent.httpsAgent.options.options[k] = v;
} }
agent = this.client.options.http.agent; agent = this.client.options.http.agent;
} else { } else {