Last active
December 19, 2015 09:39
-
-
Save ajwinn/5935094 to your computer and use it in GitHub Desktop.
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 index.html is in same directory as ServerOn8888 | |
#Because of proxyOn3333, it attempts loading localhost:3333/jquery-1.7.2.js | |
#instead of localhost:8888/jquery-1.7.2.js | |
<html> | |
<head> | |
<script src="jquery-1.7.2.js" type="text/javascript"></script> | |
</head> | |
</html> |
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
var http = require('http'), | |
httpProxy = require('http-proxy'); | |
var options = { | |
pathnameOnly:true, | |
router: { | |
'/serverOn8888':'127.0.0.1:8888' | |
} | |
} | |
httpProxy.createServer(options).listen(3333); |
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
#ServerOn8888 Directory Listing | |
index.html | |
jquery-1.7.2.js | |
ServerOn8888.js |
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
var connect = require('connect'); | |
connect.createServer( | |
connect.static(__dirname) | |
).listen(8888); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment