From df37573ea3b39a63f64418ed703cecc3ad0eab3d Mon Sep 17 00:00:00 2001 From: Floris Vink Date: Fri, 18 Oct 2019 10:05:58 +0200 Subject: [PATCH] emit event on CONNECT response --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 3ee9abc..295ab8d 100644 --- a/index.js +++ b/index.js @@ -156,6 +156,8 @@ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { connectReq.removeAllListeners() socket.removeAllListeners() + options.request.emit('tunnel_connect_response', res) + if (res.statusCode === 200) { assert.equal(head.length, 0) debug('tunneling connection has established')