Skip to content

Commit

Permalink
[refactor] s/node-http-proxy/http-proxy
Browse files Browse the repository at this point in the history
`node-` is redundant in `lib`.
  • Loading branch information
mmalecki committed Sep 24, 2012
1 parent a89a5b8 commit 3abac2b
Show file tree
Hide file tree
Showing 28 changed files with 871 additions and 31 deletions.
2 changes: 1 addition & 1 deletion bin/node-http-proxy
Expand Up @@ -4,7 +4,7 @@ var path = require('path'),
fs = require('fs'),
util = require('util'),
argv = require('optimist').argv,
httpProxy = require('../lib/node-http-proxy');
httpProxy = require('../');

var help = [
"usage: node-http-proxy [options] ",
Expand Down
4 changes: 2 additions & 2 deletions examples/balancer/simple-balancer.js
@@ -1,4 +1,4 @@
var httpProxy = require('../../lib/node-http-proxy');
var httpProxy = require('../../');
//
// A simple round-robin load balancing strategy.
//
Expand Down Expand Up @@ -33,4 +33,4 @@ httpProxy.createServer(function (req, res, proxy) {
addresses.push(target);
}).listen(8000);

// Rinse; repeat; enjoy.
// Rinse; repeat; enjoy.
2 changes: 1 addition & 1 deletion examples/http/basic-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

var welcome = [
'# # ##### ##### ##### ##### ##### #### # # # #',
Expand Down
2 changes: 1 addition & 1 deletion examples/http/concurrent-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Basic Http Proxy Server
Expand Down
4 changes: 2 additions & 2 deletions examples/http/custom-proxy-error.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Http Proxy Server with Latency
Expand All @@ -51,4 +51,4 @@ server.proxy.on('proxyError', function (err, req, res) {
});


util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8002 '.yellow + 'with custom error message'.magenta.underline);
util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8002 '.yellow + 'with custom error message'.magenta.underline);
4 changes: 2 additions & 2 deletions examples/http/forward-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Setup proxy server with forwarding
Expand Down Expand Up @@ -60,4 +60,4 @@ http.createServer(function (req, res) {

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 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);
2 changes: 1 addition & 1 deletion examples/http/latent-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Http Proxy Server with Latency
Expand Down
2 changes: 1 addition & 1 deletion examples/http/proxy-https-to-http.js
Expand Up @@ -28,7 +28,7 @@ var https = require('https'),
http = require('http'),
util = require('util'),
colors = require('colors'),
httpProxy = require('../../lib/node-http-proxy'),
httpProxy = require('../../'),
helpers = require('../../test/helpers');

//
Expand Down
2 changes: 1 addition & 1 deletion examples/http/proxy-https-to-https.js
Expand Up @@ -28,7 +28,7 @@ var https = require('https'),
http = require('http'),
util = require('util'),
colors = require('colors'),
httpProxy = require('../../lib/node-http-proxy'),
httpProxy = require('../../'),
helpers = require('../../test/helpers');

//
Expand Down
2 changes: 1 addition & 1 deletion examples/http/proxy-table.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Http Proxy Server with Proxy Table
Expand Down
2 changes: 1 addition & 1 deletion examples/http/standalone-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Http Server with proxyRequest Handler and Latency
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/bodyDecoder-middleware.js
Expand Up @@ -42,7 +42,7 @@ http.createServer(new Store().handler()).listen(7531, function () {
//don't worry about incoming contont type
//bodyParser.parse[''] = JSON.parse

require('../../lib/node-http-proxy').createServer(
require('../../').createServer(
//refactor the body parser and re-streamer into a separate package
bodyParser(),
//body parser absorbs the data and end events before passing control to the next
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/gzip-middleware-proxytable.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Basic Http Proxy Server
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/gzip-middleware.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Basic Http Proxy Server
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/jsonp-middleware.js
Expand Up @@ -24,7 +24,7 @@ var Store = require('../helpers/store')

http.createServer(new Store().handler()).listen(7531)

require('../../lib/node-http-proxy').createServer(
require('../../').createServer(
require('connect-jsonp')(true),
'localhost', 7531
).listen(1337)
2 changes: 1 addition & 1 deletion examples/middleware/modifyResponse-middleware.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Basic Http Proxy Server
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/url-middleware.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

//
// Now we set up our proxy.
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/url-middleware2.js
@@ -1,7 +1,7 @@
var util = require('util'),
colors = require('colors'),
http = require('http'),
httpProxy = require('../../lib/node-http-proxy'),
httpProxy = require('../../');
Store = require('../helpers/store')

http.createServer(new Store().handler()).listen(7531)
Expand Down
2 changes: 1 addition & 1 deletion examples/websocket/latent-websocket-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
http = require('http'),
colors = require('colors'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

try {
var io = require('socket.io'),
Expand Down
2 changes: 1 addition & 1 deletion examples/websocket/standalone-websocket-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
http = require('http'),
colors = require('colors'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

try {
var io = require('socket.io'),
Expand Down
2 changes: 1 addition & 1 deletion examples/websocket/websocket-proxy.js
Expand Up @@ -27,7 +27,7 @@
var util = require('util'),
http = require('http'),
colors = require('colors'),
httpProxy = require('../../lib/node-http-proxy');
httpProxy = require('../../');

try {
var io = require('socket.io'),
Expand Down
8 changes: 4 additions & 4 deletions lib/node-http-proxy.js → lib/http-proxy.js
Expand Up @@ -38,9 +38,9 @@ require('pkginfo')(module, 'version');
//
// ### Export the relevant objects exposed by `node-http-proxy`
//
var HttpProxy = exports.HttpProxy = require('./node-http-proxy/http-proxy').HttpProxy,
ProxyTable = exports.ProxyTable = require('./node-http-proxy/proxy-table').ProxyTable,
RoutingProxy = exports.RoutingProxy = require('./node-http-proxy/routing-proxy').RoutingProxy;
var HttpProxy = exports.HttpProxy = require('./http-proxy/http-proxy').HttpProxy,
ProxyTable = exports.ProxyTable = require('./http-proxy/proxy-table').ProxyTable,
RoutingProxy = exports.RoutingProxy = require('./http-proxy/routing-proxy').RoutingProxy;

//
// ### function createServer ([port, host, options, handler])
Expand Down Expand Up @@ -392,4 +392,4 @@ exports._getBase = function _getBase (options) {
}

return result;
};
};
Expand Up @@ -27,7 +27,7 @@
var events = require('events'),
http = require('http'),
util = require('util'),
httpProxy = require('../node-http-proxy');
httpProxy = require('../../');

//
// ### function HttpProxy (options)
Expand Down

0 comments on commit 3abac2b

Please sign in to comment.