Skip to content

Instantly share code, notes, and snippets.

@BretFisher
Created October 4, 2014 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BretFisher/5ca9b19205432a8e5c1c to your computer and use it in GitHub Desktop.
Save BretFisher/5ca9b19205432a8e5c1c to your computer and use it in GitHub Desktop.
Meteor HTTPS Proxy for running your own Linux server (not meteor.com, modulus.io, etc.)
// run this http-proxy npm package on same server as your meteor app
// I use demeteorizer to turn meteor bundle into full node app
// I use forever to run the meteor app and this app on same server
// only npm needed is http-proxy from nodejitsu
var fs = require("fs");
var httpProxy = require('http-proxy');
httpProxy.createServer({
target: {
host: 'localhost',
port: 8000 // port Meteor should run on.
},
ws: true, // yay web sockets ftw
ssl: {
key: fs.readFileSync("private.key"), // private key
ca: fs.readFileSync("intermediate.crt"), // intermediate if needed, optional
cert: fs.readFileSync("public.crt") // public cert
}
}).listen(8001); // the port SSL will be on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment