From 7abbffdc5cd03c18a23e870eb18ac9d7d7f8bccd Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Thu, 24 Feb 2022 22:46:09 +0100 Subject: [PATCH 1/3] Replace all `util.puts()` with `console.log()` Following deprecation recommendation at https://nodejs.org/docs/latest-v8.x/api/util.html#util_util_puts_strings --- examples/http/basic-proxy.js | 6 +++--- examples/http/concurrent-proxy.js | 4 ++-- examples/http/custom-proxy-error.js | 2 +- examples/http/error-handling.js | 2 +- examples/http/forward-and-target-proxy.js | 8 ++++---- examples/http/forward-proxy.js | 6 +++--- examples/http/latent-proxy.js | 4 ++-- examples/http/proxy-http-to-https.js | 2 +- examples/http/proxy-https-to-http.js | 4 ++-- examples/http/proxy-https-to-https.js | 4 ++-- examples/http/reverse-proxy.js | 4 ++-- examples/http/sse.js | 4 ++-- examples/http/standalone-proxy.js | 4 ++-- examples/middleware/gzip-middleware.js | 4 ++-- examples/middleware/modifyResponse-middleware.js | 4 ++-- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/http/basic-proxy.js b/examples/http/basic-proxy.js index dede897f3..f26e38a74 100644 --- a/examples/http/basic-proxy.js +++ b/examples/http/basic-proxy.js @@ -38,7 +38,7 @@ var welcome = [ '# # # # # # # # #### # # # ' ].join('\n'); -util.puts(welcome.rainbow.bold); +console.log(welcome.rainbow.bold); // // Basic Http Proxy Server @@ -56,5 +56,5 @@ http.createServer(function (req, res) { res.end(); }).listen(9003); -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8003'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9003 '.yellow); +console.log('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8003'.yellow); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9003 '.yellow); diff --git a/examples/http/concurrent-proxy.js b/examples/http/concurrent-proxy.js index 7e54935dd..439ace466 100644 --- a/examples/http/concurrent-proxy.js +++ b/examples/http/concurrent-proxy.js @@ -64,5 +64,5 @@ http.createServer(function (req, res) { } }).listen(9004); -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8004'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9004 '.yellow); +console.log('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8004'.yellow); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9004 '.yellow); diff --git a/examples/http/custom-proxy-error.js b/examples/http/custom-proxy-error.js index 855995fdf..91167ca8b 100644 --- a/examples/http/custom-proxy-error.js +++ b/examples/http/custom-proxy-error.js @@ -52,4 +52,4 @@ proxy.on('error', function (err, req, res) { }); -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8005 '.yellow + 'with custom error message'.magenta.underline); \ No newline at end of file +console.log('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8005 '.yellow + 'with custom error message'.magenta.underline); \ No newline at end of file diff --git a/examples/http/error-handling.js b/examples/http/error-handling.js index a20360325..a4835a4b3 100644 --- a/examples/http/error-handling.js +++ b/examples/http/error-handling.js @@ -60,4 +60,4 @@ function requestHandler(req, res) { } http.createServer(requestHandler).listen(8000); -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); +console.log('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow); diff --git a/examples/http/forward-and-target-proxy.js b/examples/http/forward-and-target-proxy.js index 5f4231add..dca6a6668 100644 --- a/examples/http/forward-and-target-proxy.js +++ b/examples/http/forward-and-target-proxy.js @@ -56,12 +56,12 @@ http.createServer(function (req, res) { // Target Http Forwarding Server // http.createServer(function (req, res) { - util.puts('Receiving forward for: ' + req.url); + console.log('Receiving forward for: ' + req.url); res.writeHead(200, { 'Content-Type': 'text/plain' }); res.write('request successfully forwarded to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); res.end(); }).listen(9007); -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8006 '.yellow + 'with forward proxy'.magenta.underline); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9006 '.yellow); -util.puts('http forward server '.blue + 'started '.green.bold + 'on port '.blue + '9007 '.yellow); \ No newline at end of file +console.log('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8006 '.yellow + 'with forward proxy'.magenta.underline); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9006 '.yellow); +console.log('http forward server '.blue + 'started '.green.bold + 'on port '.blue + '9007 '.yellow); \ No newline at end of file diff --git a/examples/http/forward-proxy.js b/examples/http/forward-proxy.js index d0bc30ca0..6f9ede9f7 100644 --- a/examples/http/forward-proxy.js +++ b/examples/http/forward-proxy.js @@ -43,11 +43,11 @@ httpProxy.createServer({ // Target Http Forwarding Server // http.createServer(function (req, res) { - util.puts('Receiving forward for: ' + req.url); + console.log('Receiving forward for: ' + req.url); res.writeHead(200, { 'Content-Type': 'text/plain' }); res.write('request successfully forwarded to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); res.end(); }).listen(9019); -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8019 '.yellow + 'with forward proxy'.magenta.underline); -util.puts('http forward server '.blue + 'started '.green.bold + 'on port '.blue + '9019 '.yellow); \ No newline at end of file +console.log('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8019 '.yellow + 'with forward proxy'.magenta.underline); +console.log('http forward server '.blue + 'started '.green.bold + 'on port '.blue + '9019 '.yellow); \ No newline at end of file diff --git a/examples/http/latent-proxy.js b/examples/http/latent-proxy.js index 0c8ba5d16..1597a90b5 100644 --- a/examples/http/latent-proxy.js +++ b/examples/http/latent-proxy.js @@ -50,5 +50,5 @@ http.createServer(function (req, res) { res.end(); }).listen(9008); -util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8008 '.yellow + 'with latency'.magenta.underline); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9008 '.yellow); +console.log('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8008 '.yellow + 'with latency'.magenta.underline); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9008 '.yellow); diff --git a/examples/http/proxy-http-to-https.js b/examples/http/proxy-http-to-https.js index 4df98e4d6..7e3b4ed72 100644 --- a/examples/http/proxy-http-to-https.js +++ b/examples/http/proxy-http-to-https.js @@ -43,4 +43,4 @@ httpProxy.createProxyServer({ } }).listen(8011); -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8011'.yellow); \ No newline at end of file +console.log('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8011'.yellow); \ No newline at end of file diff --git a/examples/http/proxy-https-to-http.js b/examples/http/proxy-https-to-http.js index 5eb07a14c..2c3b71c81 100644 --- a/examples/http/proxy-https-to-http.js +++ b/examples/http/proxy-https-to-http.js @@ -56,5 +56,5 @@ httpProxy.createServer({ } }).listen(8009); -util.puts('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8009'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9009 '.yellow); +console.log('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8009'.yellow); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9009 '.yellow); diff --git a/examples/http/proxy-https-to-https.js b/examples/http/proxy-https-to-https.js index e600f389c..594cdb59c 100644 --- a/examples/http/proxy-https-to-https.js +++ b/examples/http/proxy-https-to-https.js @@ -55,5 +55,5 @@ httpProxy.createServer({ secure: false }).listen(8010); -util.puts('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8010'.yellow); -util.puts('https server '.blue + 'started '.green.bold + 'on port '.blue + '9010 '.yellow); +console.log('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8010'.yellow); +console.log('https server '.blue + 'started '.green.bold + 'on port '.blue + '9010 '.yellow); diff --git a/examples/http/reverse-proxy.js b/examples/http/reverse-proxy.js index b07caa5a8..b4d536a63 100644 --- a/examples/http/reverse-proxy.js +++ b/examples/http/reverse-proxy.js @@ -30,14 +30,14 @@ var http = require('http'), var proxy = httpProxy.createServer(); var server = http.createServer(function (req, res) { - util.puts('Receiving reverse proxy request for:' + req.url); + console.log('Receiving reverse proxy request for:' + req.url); var parsedUrl = url.parse(req.url); var target = parsedUrl.protocol + '//' + parsedUrl.hostname; proxy.web(req, res, {target: target, secure: false}); }).listen(8213); server.on('connect', function (req, socket) { - util.puts('Receiving reverse proxy request for:' + req.url); + console.log('Receiving reverse proxy request for:' + req.url); var serverUrl = url.parse('https://' + req.url); diff --git a/examples/http/sse.js b/examples/http/sse.js index ef4693ec3..f7909280e 100644 --- a/examples/http/sse.js +++ b/examples/http/sse.js @@ -63,5 +63,5 @@ sse.on('connection', function(client) { server.listen(9003); -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8003'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9003 '.yellow); +console.log('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8003'.yellow); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9003 '.yellow); diff --git a/examples/http/standalone-proxy.js b/examples/http/standalone-proxy.js index 0c89c6cdb..982b125d4 100644 --- a/examples/http/standalone-proxy.js +++ b/examples/http/standalone-proxy.js @@ -50,5 +50,5 @@ http.createServer(function (req, res) { res.end(); }).listen(9002); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '8002 '.yellow + 'with proxy.web() handler'.cyan.underline + ' and latency'.magenta); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9002 '.yellow); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '8002 '.yellow + 'with proxy.web() handler'.cyan.underline + ' and latency'.magenta); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9002 '.yellow); diff --git a/examples/middleware/gzip-middleware.js b/examples/middleware/gzip-middleware.js index 7cbb49a0c..13e0dd19c 100644 --- a/examples/middleware/gzip-middleware.js +++ b/examples/middleware/gzip-middleware.js @@ -61,5 +61,5 @@ http.createServer(function (req, res) { res.end(); }).listen(9012); -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8012'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9012 '.yellow); +console.log('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8012'.yellow); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9012 '.yellow); diff --git a/examples/middleware/modifyResponse-middleware.js b/examples/middleware/modifyResponse-middleware.js index 41c4cec8c..9c8fe8f22 100644 --- a/examples/middleware/modifyResponse-middleware.js +++ b/examples/middleware/modifyResponse-middleware.js @@ -64,6 +64,6 @@ http.createServer(function (req, res) { res.end('Hello, I love Ruby\n'); }).listen(9013); -util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8013'.yellow); -util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9013 '.yellow); +console.log('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8013'.yellow); +console.log('http server '.blue + 'started '.green.bold + 'on port '.blue + '9013 '.yellow); From a480f895afa4cb2b537b453a0b9531db130c3705 Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Thu, 24 Feb 2022 22:47:24 +0100 Subject: [PATCH 2/3] Replace all `util.debug()` with `console.error()` Following deprecation recommendation at https://nodejs.org/docs/latest-v8.x/api/util.html#util_util_error_strings --- examples/websocket/latent-websocket-proxy.js | 6 +++--- examples/websocket/standalone-websocket-proxy.js | 6 +++--- examples/websocket/websocket-proxy.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/websocket/latent-websocket-proxy.js b/examples/websocket/latent-websocket-proxy.js index f5ad868bc..b16509c93 100644 --- a/examples/websocket/latent-websocket-proxy.js +++ b/examples/websocket/latent-websocket-proxy.js @@ -45,10 +45,10 @@ catch (ex) { // var server = io.listen(9016); server.sockets.on('connection', function (client) { - util.debug('Got websocket connection'); + console.error('Got websocket connection'); client.on('message', function (msg) { - util.debug('Got message from client: ' + msg); + console.error('Got message from client: ' + msg); }); client.send('from server'); @@ -86,6 +86,6 @@ proxyServer.listen(8016); var ws = client.connect('ws://localhost:8016'); ws.on('message', function (msg) { - util.debug('Got message: ' + msg); + console.error('Got message: ' + msg); ws.send('I am the client'); }); diff --git a/examples/websocket/standalone-websocket-proxy.js b/examples/websocket/standalone-websocket-proxy.js index 78ac697f0..816822014 100644 --- a/examples/websocket/standalone-websocket-proxy.js +++ b/examples/websocket/standalone-websocket-proxy.js @@ -45,10 +45,10 @@ catch (ex) { // var server = io.listen(9015); server.sockets.on('connection', function (client) { - util.debug('Got websocket connection'); + console.error('Got websocket connection'); client.on('message', function (msg) { - util.debug('Got message from client: ' + msg); + console.error('Got message from client: ' + msg); }); client.send('from server'); @@ -83,6 +83,6 @@ proxyServer.listen(8015); var ws = client.connect('ws://localhost:8015'); ws.on('message', function (msg) { - util.debug('Got message: ' + msg); + console.error('Got message: ' + msg); ws.send('I am the client'); }); diff --git a/examples/websocket/websocket-proxy.js b/examples/websocket/websocket-proxy.js index 5feacb4f4..0da51e6a3 100644 --- a/examples/websocket/websocket-proxy.js +++ b/examples/websocket/websocket-proxy.js @@ -45,10 +45,10 @@ catch (ex) { // var server = io.listen(9014); server.sockets.on('connection', function (client) { - util.debug('Got websocket connection'); + console.error('Got websocket connection'); client.on('message', function (msg) { - util.debug('Got message from client: ' + msg); + console.error('Got message from client: ' + msg); }); client.send('from server'); @@ -65,6 +65,6 @@ httpProxy.createServer({ target: 'ws://localhost:9014', ws: true }).listen(8014) var ws = client.connect('ws://localhost:8014'); ws.on('message', function (msg) { - util.debug('Got message: ' + msg); + console.error('Got message: ' + msg); ws.send('I am the client'); }); From 5b15e9355978e0d6ce9bc61bca1e8825a6c6fa38 Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Thu, 24 Feb 2022 22:50:07 +0100 Subject: [PATCH 3/3] Remove all unused imports of `util`. --- examples/http/basic-proxy.js | 3 +-- examples/http/concurrent-proxy.js | 3 +-- examples/http/custom-proxy-error.js | 3 +-- examples/http/error-handling.js | 3 +-- examples/http/forward-and-target-proxy.js | 3 +-- examples/http/forward-proxy.js | 3 +-- examples/http/latent-proxy.js | 3 +-- examples/http/proxy-http-to-https.js | 1 - examples/http/proxy-https-to-http.js | 1 - examples/http/proxy-https-to-https.js | 1 - examples/http/reverse-proxy.js | 3 +-- examples/http/sse.js | 3 +-- examples/http/standalone-proxy.js | 3 +-- examples/middleware/bodyDecoder-middleware.js | 1 - examples/middleware/gzip-middleware.js | 3 +-- examples/middleware/modifyResponse-middleware.js | 3 +-- examples/websocket/latent-websocket-proxy.js | 3 +-- examples/websocket/standalone-websocket-proxy.js | 3 +-- examples/websocket/websocket-proxy.js | 3 +-- 19 files changed, 15 insertions(+), 34 deletions(-) diff --git a/examples/http/basic-proxy.js b/examples/http/basic-proxy.js index f26e38a74..7164ae7a6 100644 --- a/examples/http/basic-proxy.js +++ b/examples/http/basic-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/http/concurrent-proxy.js b/examples/http/concurrent-proxy.js index 439ace466..2c030571f 100644 --- a/examples/http/concurrent-proxy.js +++ b/examples/http/concurrent-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/http/custom-proxy-error.js b/examples/http/custom-proxy-error.js index 91167ca8b..1b7b5b4ae 100644 --- a/examples/http/custom-proxy-error.js +++ b/examples/http/custom-proxy-error.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/http/error-handling.js b/examples/http/error-handling.js index a4835a4b3..f05148190 100644 --- a/examples/http/error-handling.js +++ b/examples/http/error-handling.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/http/forward-and-target-proxy.js b/examples/http/forward-and-target-proxy.js index dca6a6668..19121144d 100644 --- a/examples/http/forward-and-target-proxy.js +++ b/examples/http/forward-and-target-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/http/forward-proxy.js b/examples/http/forward-proxy.js index 6f9ede9f7..61a483b47 100644 --- a/examples/http/forward-proxy.js +++ b/examples/http/forward-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/http/latent-proxy.js b/examples/http/latent-proxy.js index 1597a90b5..d69f32656 100644 --- a/examples/http/latent-proxy.js +++ b/examples/http/latent-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/http/proxy-http-to-https.js b/examples/http/proxy-http-to-https.js index 7e3b4ed72..45fa9e87c 100644 --- a/examples/http/proxy-http-to-https.js +++ b/examples/http/proxy-http-to-https.js @@ -26,7 +26,6 @@ var https = require('https'), http = require('http'), - util = require('util'), path = require('path'), fs = require('fs'), colors = require('colors'), diff --git a/examples/http/proxy-https-to-http.js b/examples/http/proxy-https-to-http.js index 2c3b71c81..769d42f62 100644 --- a/examples/http/proxy-https-to-http.js +++ b/examples/http/proxy-https-to-http.js @@ -26,7 +26,6 @@ var https = require('https'), http = require('http'), - util = require('util'), path = require('path'), fs = require('fs'), colors = require('colors'), diff --git a/examples/http/proxy-https-to-https.js b/examples/http/proxy-https-to-https.js index 594cdb59c..d92b7349d 100644 --- a/examples/http/proxy-https-to-https.js +++ b/examples/http/proxy-https-to-https.js @@ -26,7 +26,6 @@ var https = require('https'), http = require('http'), - util = require('util'), fs = require('fs'), path = require('path'), colors = require('colors'), diff --git a/examples/http/reverse-proxy.js b/examples/http/reverse-proxy.js index b4d536a63..f85ec2d51 100644 --- a/examples/http/reverse-proxy.js +++ b/examples/http/reverse-proxy.js @@ -24,8 +24,7 @@ var http = require('http'), net = require('net'), httpProxy = require('../../lib/http-proxy'), - url = require('url'), - util = require('util'); + url = require('url'); var proxy = httpProxy.createServer(); diff --git a/examples/http/sse.js b/examples/http/sse.js index f7909280e..34bc5df08 100644 --- a/examples/http/sse.js +++ b/examples/http/sse.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'), SSE = require('sse'); diff --git a/examples/http/standalone-proxy.js b/examples/http/standalone-proxy.js index 982b125d4..cc9e33870 100644 --- a/examples/http/standalone-proxy.js +++ b/examples/http/standalone-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/middleware/bodyDecoder-middleware.js b/examples/middleware/bodyDecoder-middleware.js index 71e16c8ac..030f454fb 100644 --- a/examples/middleware/bodyDecoder-middleware.js +++ b/examples/middleware/bodyDecoder-middleware.js @@ -28,7 +28,6 @@ var http = require('http'), connect = require('connect'), request = require('request'), colors = require('colors'), - util = require('util'), queryString = require('querystring'), bodyParser = require('body-parser'), httpProxy = require('../../lib/http-proxy'), diff --git a/examples/middleware/gzip-middleware.js b/examples/middleware/gzip-middleware.js index 13e0dd19c..7220656cb 100644 --- a/examples/middleware/gzip-middleware.js +++ b/examples/middleware/gzip-middleware.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), connect = require('connect'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/middleware/modifyResponse-middleware.js b/examples/middleware/modifyResponse-middleware.js index 9c8fe8f22..333eb3a33 100644 --- a/examples/middleware/modifyResponse-middleware.js +++ b/examples/middleware/modifyResponse-middleware.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - colors = require('colors'), +var colors = require('colors'), http = require('http'), connect = require('connect'), app = connect(), diff --git a/examples/websocket/latent-websocket-proxy.js b/examples/websocket/latent-websocket-proxy.js index b16509c93..f85afd208 100644 --- a/examples/websocket/latent-websocket-proxy.js +++ b/examples/websocket/latent-websocket-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - http = require('http'), +var http = require('http'), colors = require('colors'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/websocket/standalone-websocket-proxy.js b/examples/websocket/standalone-websocket-proxy.js index 816822014..7f5a3b317 100644 --- a/examples/websocket/standalone-websocket-proxy.js +++ b/examples/websocket/standalone-websocket-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - http = require('http'), +var http = require('http'), colors = require('colors'), httpProxy = require('../../lib/http-proxy'); diff --git a/examples/websocket/websocket-proxy.js b/examples/websocket/websocket-proxy.js index 0da51e6a3..9a1c71e95 100644 --- a/examples/websocket/websocket-proxy.js +++ b/examples/websocket/websocket-proxy.js @@ -24,8 +24,7 @@ */ -var util = require('util'), - http = require('http'), +var http = require('http'), colors = require('colors'), httpProxy = require('../../lib/http-proxy');