-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ddd83e
commit ce43f73
Showing
5 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
var server = require('./server/server'); | ||
|
||
var port = <port>; | ||
var port = '<port>'; | ||
|
||
server.start(port); | ||
server.start(parseInt(port,10)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var http = require('http'); | ||
var __request = http.request; | ||
exports.request = __request; | ||
|
||
var proxy = { | ||
host: '', | ||
port: 0 | ||
}; | ||
|
||
var _debug = false; | ||
|
||
http.request = function (options, callback) { | ||
var __options = options; | ||
__options.path = 'http://' + options.host + options.path; | ||
__options.host = proxy.host; | ||
__options.port = proxy.port; | ||
if (_debug) { | ||
console.log('=== http-proxy.js begin debug ==='); | ||
console.log(JSON.stringify(__options, null, 2)); | ||
console.log('=== http-proxy.js end debug ==='); | ||
} | ||
var req = __request(__options, function (res) { | ||
callback(res); | ||
}); | ||
return req; | ||
}; | ||
|
||
module.exports = function (host, port, debug) { | ||
proxy.host = host; | ||
proxy.port = port; | ||
_debug = debug || false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"proxy": "", | ||
"directory": "bower_components", | ||
"registry": "http://<ip-address>:<port>", | ||
"registry.search": "http://<ip-address>:<port>", | ||
"registry.register": "http://<ip-address>:<port>", | ||
"registry.publish": "http://<ip-address>:<port>", | ||
"proxy": "" | ||
"registry.publish": "http://<ip-address>:<port>" | ||
} |