mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[minor] Fix syntax in examples/
This commit is contained in:
parent
e6c52d431f
commit
ff829467d3
@ -46,7 +46,7 @@ https.createServer(opts, function (req, res) {
|
|||||||
// Create the proxy server listening on port 443.
|
// Create the proxy server listening on port 443.
|
||||||
//
|
//
|
||||||
httpProxy.createServer(443, 'localhost', {
|
httpProxy.createServer(443, 'localhost', {
|
||||||
https: opts,
|
https: opts
|
||||||
}).listen(8080);
|
}).listen(8080);
|
||||||
|
|
||||||
util.puts('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow);
|
util.puts('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow);
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var util = require('util'),
|
var util = require('util'),
|
||||||
colors = require('colors')
|
colors = require('colors'),
|
||||||
http = require('http'),
|
http = require('http'),
|
||||||
httpProxy = require('./../lib/node-http-proxy');
|
httpProxy = require('./../lib/node-http-proxy');
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var util = require('util'),
|
var util = require('util'),
|
||||||
colors = require('colors')
|
colors = require('colors'),
|
||||||
http = require('http'),
|
http = require('http'),
|
||||||
httpProxy = require('./../lib/node-http-proxy');
|
httpProxy = require('./../lib/node-http-proxy');
|
||||||
|
|
||||||
@ -52,12 +52,12 @@ http.createServer(function (req, res) {
|
|||||||
// Target Http Forwarding Server
|
// Target Http Forwarding Server
|
||||||
//
|
//
|
||||||
http.createServer(function (req, res) {
|
http.createServer(function (req, res) {
|
||||||
util.puts('Receiving forward for: ' + req.url)
|
util.puts('Receiving forward for: ' + req.url);
|
||||||
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
||||||
res.write('request successfully forwarded to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2));
|
res.write('request successfully forwarded to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2));
|
||||||
res.end();
|
res.end();
|
||||||
}).listen(9001);
|
}).listen(9001);
|
||||||
|
|
||||||
util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8003 '.yellow + 'with forward proxy'.magenta.underline)
|
util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8003 '.yellow + 'with forward proxy'.magenta.underline);
|
||||||
util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow);
|
util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow);
|
||||||
util.puts('http forward server '.blue + 'started '.green.bold + 'on port '.blue + '9001 '.yellow);
|
util.puts('http forward server '.blue + 'started '.green.bold + 'on port '.blue + '9001 '.yellow);
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var util = require('util'),
|
var util = require('util'),
|
||||||
colors = require('colors')
|
colors = require('colors'),
|
||||||
http = require('http'),
|
http = require('http'),
|
||||||
httpProxy = require('./../lib/node-http-proxy');
|
httpProxy = require('./../lib/node-http-proxy');
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ httpProxy.createServer(function (req, res, proxy) {
|
|||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
buffer: buffer
|
buffer: buffer
|
||||||
});
|
});
|
||||||
}, 200)
|
}, 200);
|
||||||
}).listen(8002);
|
}).listen(8002);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var util = require('util'),
|
var util = require('util'),
|
||||||
colors = require('colors')
|
colors = require('colors'),
|
||||||
http = require('http'),
|
http = require('http'),
|
||||||
httpProxy = require('./../lib/node-http-proxy');
|
httpProxy = require('./../lib/node-http-proxy');
|
||||||
|
|
||||||
@ -47,5 +47,5 @@ http.createServer(function (req, res) {
|
|||||||
res.end();
|
res.end();
|
||||||
}).listen(9000);
|
}).listen(9000);
|
||||||
|
|
||||||
util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8001 '.yellow + 'with proxy table'.magenta.underline)
|
util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8001 '.yellow + 'with proxy table'.magenta.underline);
|
||||||
util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow);
|
util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow);
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var util = require('util'),
|
var util = require('util'),
|
||||||
colors = require('colors')
|
colors = require('colors'),
|
||||||
http = require('http'),
|
http = require('http'),
|
||||||
httpProxy = require('./../lib/node-http-proxy');
|
httpProxy = require('./../lib/node-http-proxy');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user