Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick node.js HTTP proxy on Heroku

Spin up a quick proxy on Heroku. Make sure you have heroku and git on your computer:

  1. Download these files into a directory
  2. Change 'some-target.com' to your target domain index.js
  3. $ git init
  4. $ git add .
  5. $ git commit -m "And away we go..."
  6. $ heroku create
  7. $ git push heroku master
  8. $ heroku ps:scale web=1
  9. $ heroku open

If you have trouble with Heroku, consult their node.js getting started guide.

var httpProxy = require('http-proxy');
httpProxy.createServer(80, 'some-target.com').listen(process.env.PORT || 8000);
{
"name": "proxy",
"version": "0.0.0",
"description": "Proxy something",
"main": "index.js",
"repository": "",
"author": "",
"license": "BSD",
"dependencies": {
"http-proxy": "~0.8.5"
},
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}
web: node index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.