mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] naming
This commit is contained in:
parent
79a14acfd2
commit
893100972c
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user