Skip to content

Instantly share code, notes, and snippets.

@jgrgt
Created March 13, 2015 08:55
Show Gist options
  • Save jgrgt/13edd137cd2b3f98dec9 to your computer and use it in GitHub Desktop.
Save jgrgt/13edd137cd2b3f98dec9 to your computer and use it in GitHub Desktop.
Locking up an npm connect proxy
{
"devDependencies": {
"connect": "~3.3.4",
"proxy-middleware": "~0.11.0",
"url": "~0.10.3",
"http": "0.0.0"
},
"scripts": {
"start": "node server.js"
}
}
#!/bin/bash
while :
do
curl -v http://127.0.0.1:8888/proxy/realnitro_300.png | head -c 20 > /dev/null
done
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