Skip to content

Commit

Permalink
[fix] naming
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Sep 14, 2013
1 parent 79a14ac commit 8931009
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/caronte/passes/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ function stream(req, socket, options, head) {
common.setupOutgoing(options.ssl || {}, options, req)
);

r.on('upgrade', function(res, proxySock, hd) {
if (hd && hd.length) proxySock.unshift(hd);
r.on('upgrade', function(proxyRes, proxySocket, proxyHead) {
if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead);

socket.write('HTTP/1.1 101 Switching Protocols\r\n');
socket.write(Object.keys(res.headers).map(function(i) {
return i + ": " + res.headers[i];
socket.write(Object.keys(proxyRes.headers).map(function(i) {
return i + ": " + proxyRes.headers[i];
}).join('\r\n') + '\r\n\r\n');
proxySock.pipe(socket).pipe(proxySock);
proxySocket.pipe(socket).pipe(proxySocket);
});

r.end();
Expand Down

0 comments on commit 8931009

Please sign in to comment.