Skip to content

Instantly share code, notes, and snippets.

@chetandhembre
Last active August 29, 2015 13:56
Show Gist options
  • Save chetandhembre/9185491 to your computer and use it in GitHub Desktop.
Save chetandhembre/9185491 to your computer and use it in GitHub Desktop.
Create https proxy
var fs = require('fs'),
http = require('http'),
https = require('https'),
httpProxy = require('http-proxy');
var hskey = fs.readFileSync('./***-key.pem' , 'utf8');
var hscert = fs.readFileSync('./***-cert.pem' , 'utf8')
var options = {
https: {
key: hskey,
cert: hscert
}
};
var proxy = new httpProxy.createProxy();
https.createServer(options.https, function (req, res) {
proxy.web(req, res, { target: 'http://justunfollow.net:8088' }, function(){
console.log(arguments);
})
}).listen(7000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment