[v0.6] http.Agent uses different structure for sockets

This commit is contained in:
Maciej Małecki 2011-11-02 13:23:40 +01:00
parent 6655e01642
commit 86b4122323

View File

@ -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();
});
}
}
});
};