Skip to content

Commit 2f49810

Browse files
committed
[dist] Renamed node-proxy to node-http-proxy, updated package.json
1 parent 994f748 commit 2f49810

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

Diff for: README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# node-http-proxy - v0.1.0
22

3-
## battle-hardened node.js http reverse proxy
3+
## Battle-hardened node.js http reverse proxy
44

5-
6-
7-
###features
5+
### Features
86

97
- reverse-proxies incoming http.Server requests
108
- can be used as a CommonJS module in node.js
@@ -16,8 +14,14 @@
1614
- written entirely in javascript
1715
- easy to use api
1816

19-
###when to use node-http-proxy
17+
### When to use node-http-proxy
18+
19+
Let's suppose you were running multiple http application servers, but you only wanted to expose one machine to the internet. You could setup node-http-proxy on that one machine and then reverse-proxy the incoming http requests to locally running services which were not exposed to the outside network.
20+
21+
### Installing node-http-proxy
2022

21-
let's suppose you were running multiple http application servers, but you only wanted to expose one machine to the internet. you could setup node-http-proxy on that one machine and then reverse-proxy the incoming http requests to locally running services which were not exposed to the outside network.
23+
<pre>
24+
npm install http-proxy
25+
</pre>
2226

23-
### how to use node-http-proxy
27+
### How to use node-http-proxy

Diff for: demo.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ var vows = require('vows'),
1212
assert = require('assert'),
1313
http = require('http');
1414

15-
var NodeProxy = require('./lib/node-proxy').NodeProxy;
15+
var HttpProxy = require('./lib/node-http-proxy').HttpProxy;
1616
var testServers = {};
1717

1818

1919
// regular http server
2020
http.createServer(function (req, res){
2121
// Initialize the nodeProxy and start proxying the request
22-
var proxy = new (NodeProxy);
22+
var proxy = new (HttpProxy);
2323
proxy.init(req, res);
2424
// lets proxy the request to another service
2525
proxy.proxyRequest('localhost', '8081', req, res);
@@ -30,7 +30,7 @@ sys.puts('started a http server on port 8080'.green)
3030
// http server with latency
3131
http.createServer(function (req, res){
3232
// Initialize the nodeProxy and start proxying the request
33-
var proxy = new (NodeProxy);
33+
var proxy = new (HttpProxy);
3434
proxy.init(req, res);
3535

3636
// lets proxy the request to another service

Diff for: lib/node-proxy.js renamed to lib/node-http-proxy.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* node-proxy.js: Reverse proxy for node.js
2+
* node-http-proxy.js: Reverse proxy for node.js
33
*
44
* (C) 2010 Charlie Robbins
55
* MIT LICENSE
@@ -10,21 +10,18 @@ var sys = require('sys'),
1010
http = require('http'),
1111
events = require('events');
1212

13-
//
14-
// The NodeProxy factory
15-
//
16-
exports.NodeProxy = function () {
13+
exports.HttpProxy = function () {
1714
var self = this;
1815
this.emitter = new(events.EventEmitter);
1916

2017
// If we were passed more than two arguments,
21-
// assume they are request and response.
18+
// assume the first two are request and response.
2219
if(arguments.length >= 2) {
2320
this.init(arguments[0], arguments[1]);
2421
}
2522
};
2623

27-
exports.NodeProxy.prototype = {
24+
exports.HttpProxy.prototype = {
2825
toArray: function (obj){
2926
var len = obj.length,
3027
arr = new Array(len);

Diff for: package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"name": "node-http-proxy",
2+
"name": "http-proxy",
33
"description": "A full-featured http reverse proxy for node.js",
4-
"version": "0.5.0",
4+
"version": "0.1.0",
55
"author": "Charlie Robbins <[email protected]>",
66
"contributors": [
77
{ "name": "Marak Squires", "email": "[email protected]" },
88
],
99
"keywords": ["reverse", "proxy", "http"],
10+
"dependencies": {
11+
"colors": ">= 0.0.1"
12+
},
1013
"directories": { "lib" },
1114
"scripts": { "test": "vows" },
1215
"engines": { "node": ">= 0.1.98" }

Diff for: test/node-proxy-test.js renamed to test/node-http-proxy-test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* node-proxy-test.js: Tests for node-proxy. Reverse proxy for node.js
2+
* node-http-proxy-test.js: Tests for node-http-proxy. Reverse proxy for node.js
33
*
44
* (C) 2010 Charlie Robbins
55
* MIT LICENSE
@@ -13,7 +13,7 @@ var vows = require('vows'),
1313

1414
require.paths.unshift(require('path').join(__dirname, '../lib/'));
1515

16-
var NodeProxy = require('node-proxy').NodeProxy;
16+
var HttpProxy = require('node-http-proxy').HttpProxy;
1717
var testServers = {};
1818

1919
//
@@ -89,7 +89,7 @@ vows.describe('node-proxy').addBatch({
8989
"When an incoming request is proxied to the helloNode server" : {
9090
"with no latency" : {
9191
topic: function () {
92-
var proxy = new (NodeProxy);
92+
var proxy = new (HttpProxy);
9393
startTest(proxy, 8082);
9494
proxy.emitter.addListener('end', this.callback);
9595

@@ -106,7 +106,7 @@ vows.describe('node-proxy').addBatch({
106106
},
107107
"with latency": {
108108
topic: function () {
109-
var proxy = new (NodeProxy);
109+
var proxy = new (HttpProxy);
110110
startTestWithLatency(proxy, 8083);
111111
proxy.emitter.addListener('end', this.callback);
112112

0 commit comments

Comments
 (0)