mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] naming convention
This commit is contained in:
parent
6a03e5f7cf
commit
7d71a867a8
@ -72,11 +72,11 @@ function XHeaders(req, socket, options) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function stream(req, socket, options, head) {
|
function stream(req, socket, options, head) {
|
||||||
var r = http.request(
|
var proxyReq = http.request(
|
||||||
common.setupOutgoing(options.ssl || {}, options, req)
|
common.setupOutgoing(options.ssl || {}, options, req)
|
||||||
);
|
);
|
||||||
|
|
||||||
r.on('upgrade', function(proxyRes, proxySocket, proxyHead) {
|
proxyReq.on('upgrade', function(proxyRes, proxySocket, proxyHead) {
|
||||||
if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead);
|
if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead);
|
||||||
|
|
||||||
socket.write('HTTP/1.1 101 Switching Protocols\r\n');
|
socket.write('HTTP/1.1 101 Switching Protocols\r\n');
|
||||||
@ -86,7 +86,7 @@ function stream(req, socket, options, head) {
|
|||||||
proxySocket.pipe(socket).pipe(proxySocket);
|
proxySocket.pipe(socket).pipe(proxySocket);
|
||||||
});
|
});
|
||||||
|
|
||||||
r.end();
|
proxyReq.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
] // <--
|
] // <--
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user