Permalink
Browse files

Merge branch 'master' of https://github.com/nodejitsu/node-http-proxy

  • Loading branch information...
2 parents a094773 + fd16aeb commit 2499b20e20e82f6758a5d6b0f06c652995a51afc @gilad61 committed Jul 19, 2012
Showing with 8 additions and 8 deletions.
  1. +2 −2 lib/node-http-proxy/http-proxy.js
  2. +6 −6 vendor/websocket.js
@@ -148,7 +148,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
}
if (req.headers['x-forwarded-proto']){
- var protoToAppend = "," + (req.connection.pair) ? 'https' : 'http';
+ var protoToAppend = "," + (req.connection.pair ? 'https' : 'http');
req.headers['x-forwarded-proto'] += protoToAppend;
}
else {
@@ -415,7 +415,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
}
if (req.headers['x-forwarded-proto']){
- var protoToAppend = "," + (req.connection.pair) ? 'wss' : 'ws';
+ var protoToAppend = "," + (req.connection.pair ? 'wss' : 'ws');
req.headers['x-forwarded-proto'] += protoToAppend;
}
else {
View
@@ -38,7 +38,7 @@ var http = require('http');
var https = require('https');
var net = require('net');
var urllib = require('url');
-var sys = require('sys');
+var util = require('util');
var FRAME_NO = 0;
var FRAME_LO = 1;
@@ -52,7 +52,7 @@ var CLOSED = 3;
var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
var debug = (debugLevel & 0x4) ?
- function() { sys.error.apply(this, arguments); } :
+ function() { util.error.apply(this, arguments); } :
function() { };
// Generate a Sec-WebSocket-* value
@@ -246,7 +246,7 @@ var WebSocket = function(url, proto, opts) {
// FRAME_LO
function(buf, off) {
- debug('frame_lo(' + sys.inspect(buf) + ', ' + off + ')');
+ debug('frame_lo(' + util.inspect(buf) + ', ' + off + ')');
// Find the first instance of 0xff, our terminating byte
for (var i = off; i < buf.length && buf[i] != 0xff; i++)
@@ -306,7 +306,7 @@ var WebSocket = function(url, proto, opts) {
// FRAME_HI
function(buf, off) {
- debug('frame_hi(' + sys.inspect(buf) + ', ' + off + ')');
+ debug('frame_hi(' + util.inspect(buf) + ', ' + off + ')');
if (buf[off] !== 0) {
throw new Error('High-byte framing not supported.');
@@ -323,7 +323,7 @@ var WebSocket = function(url, proto, opts) {
return;
}
- debug('dataListener(' + sys.inspect(buf) + ')');
+ debug('dataListener(' + util.inspect(buf) + ')');
var off = 0;
var consumed = 0;
@@ -624,7 +624,7 @@ var WebSocket = function(url, proto, opts) {
httpReq.end();
})();
};
-sys.inherits(WebSocket, events.EventEmitter);
+util.inherits(WebSocket, events.EventEmitter);
exports.WebSocket = WebSocket;
// Add some constants to the WebSocket object

0 comments on commit 2499b20

Please sign in to comment.