[fix] fix the correct order of arguments in ws-incoming passes

This commit is contained in:
cronopio 2013-10-21 23:22:32 -05:00
parent 881c7e62e0
commit 02df9a33c5

View File

@ -96,22 +96,21 @@ var passes = exports;
*
* @api private
*/
function stream(req, socket, server, head, clb) {
function stream(req, socket, options, server, head, clb) {
common.setupSocket(socket);
if (head && head.length) socket.unshift(head);
var proxyReq = (~['https:', 'wss:'].indexOf(server.options.target.protocol) ? https : http).request(
common.setupOutgoing(server.options.ssl || {}, server.options, req)
var proxyReq = (~['https:', 'wss:'].indexOf(options.target.protocol) ? https : http).request(
common.setupOutgoing(options.ssl || {}, options, req)
);
// Error Handler
proxyReq.on('error', function(err){
if(server) {
server.emit('error', err);
}
else {
if (clb) {
clb(err);
} else {
server.emit('error', err, req, res);
}
});