Created
September 8, 2011 03:41
-
-
Save minodisk/1202545 to your computer and use it in GitHub Desktop.
Nodeでproxy
This file contains hidden or 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
| npm install http-proxy |
This file contains hidden or 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
| var httpProxy = require('http-proxy'); | |
| httpProxy.createServer({ | |
| router: { | |
| 'www.example.com': 'localhost:8000', | |
| 'foo.example.com': 'localhost:8001', | |
| 'bar.example.com': 'localhost:8002', | |
| 'example.com': 'localhost:8000' | |
| } | |
| }).listen(80); |
This file contains hidden or 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
| sudo -s | |
| node proxytable.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment