Skip to content

Commit 86b4122

Browse files
committed
[v0.6] http.Agent uses different structure for sockets
1 parent 6655e01 commit 86b4122

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: lib/node-http-proxy/http-proxy.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,11 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
753753
HttpProxy.prototype.close = function () {
754754
[this.forward, this.target].forEach(function (proxy) {
755755
if (proxy && proxy.agent) {
756-
proxy.agent.sockets.forEach(function (socket) {
757-
socket.end();
758-
});
756+
for (var host in proxy.agent.sockets) {
757+
proxy.agent.sockets[host].forEach(function (socket) {
758+
socket.end();
759+
});
760+
}
759761
}
760762
});
761763
};

0 commit comments

Comments
 (0)