mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] fix the correct order of arguments in ws-incoming passes
This commit is contained in:
parent
881c7e62e0
commit
02df9a33c5
@ -96,22 +96,21 @@ var passes = exports;
|
|||||||
*
|
*
|
||||||
* @api private
|
* @api private
|
||||||
*/
|
*/
|
||||||
function stream(req, socket, server, head, clb) {
|
function stream(req, socket, options, server, head, clb) {
|
||||||
common.setupSocket(socket);
|
common.setupSocket(socket);
|
||||||
|
|
||||||
if (head && head.length) socket.unshift(head);
|
if (head && head.length) socket.unshift(head);
|
||||||
|
|
||||||
|
|
||||||
var proxyReq = (~['https:', 'wss:'].indexOf(server.options.target.protocol) ? https : http).request(
|
var proxyReq = (~['https:', 'wss:'].indexOf(options.target.protocol) ? https : http).request(
|
||||||
common.setupOutgoing(server.options.ssl || {}, server.options, req)
|
common.setupOutgoing(options.ssl || {}, options, req)
|
||||||
);
|
);
|
||||||
// Error Handler
|
// Error Handler
|
||||||
proxyReq.on('error', function(err){
|
proxyReq.on('error', function(err){
|
||||||
if(server) {
|
if (clb) {
|
||||||
server.emit('error', err);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
clb(err);
|
clb(err);
|
||||||
|
} else {
|
||||||
|
server.emit('error', err, req, res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user