Update WebSocketShard.js

fix proxy to proxy-agent v5
This commit is contained in:
Ahmed 2023-11-30 14:11:45 +02:00 committed by GitHub
parent cca7d2ce66
commit cb03a1a918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -280,8 +280,8 @@ class WebSocketShard extends EventEmitter {
let args = { handshakeTimeout: 30_000 };
if (client.options.proxy.length > 0) {
const proxy = require('proxy-agent');
args.agent = new proxy.ProxyAgent(client.options.proxy);
const ProxyAgent = require('proxy-agent');
args.agent = new ProxyAgent(client.options.proxy);
this.debug(`Using proxy ${client.options.proxy}`, args);
}
// Adding a handshake timeout to just make sure no zombie connection appears.