Skip to content

Instantly share code, notes, and snippets.

@sebm
Created July 9, 2013 19:01
Show Gist options
  • Save sebm/5960229 to your computer and use it in GitHub Desktop.
Save sebm/5960229 to your computer and use it in GitHub Desktop.
A local HTTPS proxy. Prereq: `npm install http-proxy`; `openssl req -new -x509 -keyout key.pem -out cert.pem -days 365 -nodes`
var fs = require('fs'),
http = require('http'),
https = require('https'),
httpProxy = require('http-proxy');
var options = {
https: {
key: fs.readFileSync('key.pem', 'utf8'),
cert: fs.readFileSync('cert.pem', 'utf8')
}
};
//
// Create a standalone HTTPS proxy server
//
httpProxy.createServer(3000, 'example.com', options).listen(8001);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment