Created
July 9, 2013 19:01
-
-
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`
This file contains hidden or 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 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