Skip to content

Commit 8931009

Browse files
committed
[fix] naming
1 parent 79a14ac commit 8931009

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/caronte/passes/ws.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ function stream(req, socket, options, head) {
7777
common.setupOutgoing(options.ssl || {}, options, req)
7878
);
7979

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

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

9090
r.end();

0 commit comments

Comments
 (0)