Skip to content

Instantly share code, notes, and snippets.

@moderation
Created April 22, 2012 21:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moderation/2467004 to your computer and use it in GitHub Desktop.
Save moderation/2467004 to your computer and use it in GitHub Desktop.
SPDY proxy
var fs = require('fs'),
spdy = require('spdy'),
httpProxy = require('http-proxy');
var options = {
key: fs.readFileSync(__dirname + '/moderation-key.pem'),
cert: fs.readFileSync(__dirname + '/moderation-cert.pem'),
ca: fs.readFileSync(__dirname + '/moderation-csr.pem')
};
var proxy = new httpProxy.RoutingProxy();
spdy.createServer(options, function(req, res) {
proxy.proxyRequest(req, res, {
host: 'localhost',
port: 8080
});
}).listen(10443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment