Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added hostname

  • Loading branch information...
commit 78ec0a6344aab927d8c8eaaefe39f000303da46c 1 parent 31d68f7
@indutny authored
View
1  README.rdoc
@@ -15,6 +15,7 @@ From console:
"127.0.0.1:8081"
],
"addr" : "127.0.0.1:80",
+ "hostname" : "www.google.com",
"spread" : {,
"include": ".*",
"exclude": "\\\\.json$"
View
2  app.balancer
@@ -11,7 +11,7 @@
"localhost:8088",
"localhost:8089"
],
- "addr": "192.168.0.100:80",
+ "addr": "192.168.0.100:80", "hostname": "www.google.com",
"spread": {
"include": ".*",
"exclude": "new|update|talk"
View
6 lib/balancer/index.js
@@ -55,6 +55,12 @@ var Balancer = exports.Balancer = function(config) {
// Parse log
var _log = config.log || function(msg) {sys.puts('node-balancer >> ' + msg);};
+
+ // Get hostname
+ if (config.hostname) {
+ _addr[2] = config.hostname;
+ }
+
return start(_addr, _servers, _spread, _log, config.profiler);
}
View
1  node-balancer
@@ -21,6 +21,7 @@ function help() {
sys.puts(' "127.0.0.1:8081"');
sys.puts(' ],');
sys.puts(' "addr" : "127.0.0.1:80",');
+ sys.puts(' "hostname" : "www.google.com",');
sys.puts(' "spread" : {,');
sys.puts(' "include": ".*",');
sys.puts(' "exclude": "\\\\.json$"');
Please sign in to comment.
Something went wrong with that request. Please try again.