diff --git a/src/client/Client.js b/src/client/Client.js index 4000c93..48b0e51 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -397,7 +397,7 @@ class Client extends BaseClient { autoLogin: true, debug, }); - this.emit(Events.DEBUG, `Preparing to connect to the gateway`, QR); + this.emit(Events.DEBUG, `Preparing to connect to the gateway (QR Login)`, QR); return QR.connect(this); } diff --git a/src/client/websocket/WebSocketShard.js b/src/client/websocket/WebSocketShard.js index 3ed6440..b13447e 100644 --- a/src/client/websocket/WebSocketShard.js +++ b/src/client/websocket/WebSocketShard.js @@ -271,7 +271,10 @@ class WebSocketShard extends EventEmitter { this.connectedAt = Date.now(); let args = { handshakeTimeout: 30_000 }; - if (typeof client.options.proxy && client.options.proxy.length > 0) args.proxy = new proxy(client.options.proxy); + if (typeof client.options.proxy && client.options.proxy.length > 0) { + args.agent = new proxy(client.options.proxy); + this.debug(`Using proxy ${client.options.proxy}`, args); + } // Adding a handshake timeout to just make sure no zombie connection appears. const ws = (this.connection = WebSocket.create(gateway, wsQuery, args)); ws.onopen = this.onOpen.bind(this);