Created
March 13, 2015 08:55
-
-
Save jgrgt/13edd137cd2b3f98dec9 to your computer and use it in GitHub Desktop.
Locking up an npm connect proxy
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
{ | |
"devDependencies": { | |
"connect": "~3.3.4", | |
"proxy-middleware": "~0.11.0", | |
"url": "~0.10.3", | |
"http": "0.0.0" | |
}, | |
"scripts": { | |
"start": "node server.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
#!/bin/bash | |
while : | |
do | |
curl -v http://127.0.0.1:8888/proxy/realnitro_300.png | head -c 20 > /dev/null | |
done |
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'), | |
url = require('url'), | |
proxy = require('proxy-middleware'), | |
http = require('http'); | |
var app = connect(); | |
app.use('/proxy/', proxy(url.parse('http://realnitro.be/'))); | |
http.createServer(app).listen(8888); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment