Skip to content

Commit

Permalink
[v0.6] http.Agent uses different structure for sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Dec 14, 2011
1 parent 6655e01 commit 86b4122
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,11 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
HttpProxy.prototype.close = function () {
[this.forward, this.target].forEach(function (proxy) {
if (proxy && proxy.agent) {
proxy.agent.sockets.forEach(function (socket) {
socket.end();
});
for (var host in proxy.agent.sockets) {
proxy.agent.sockets[host].forEach(function (socket) {
socket.end();
});
}
}
});
};
Expand Down

0 comments on commit 86b4122

Please sign in to comment.