From bcb573756011deae28d5cf08a8b7822067db468f Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Sun, 20 Jan 2019 20:02:26 -0500 Subject: [PATCH] Pass errors from MITM SSL sockets up to the proxy object --- src/proxy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/proxy.js b/src/proxy.js index ab81bd2..305ebec 100644 --- a/src/proxy.js +++ b/src/proxy.js @@ -217,8 +217,10 @@ export default class Proxy extends EventEmitter { }) this._server.on('connect', (request, clientSocket, head) => { + clientSocket.on('error', err => this.emit('error', err)) let addr = this._tlsSpoofingServer.address() let serverSocket = net.connect(addr.port, addr.address, () => { + serverSocket.on('error', err => this.emit('error', err)) clientSocket.write(cxnEstablished) serverSocket.write(head) clientSocket