Skip to content

Instantly share code, notes, and snippets.

@huangjs
Created June 19, 2012 05:45
Show Gist options
  • Save huangjs/2952481 to your computer and use it in GitHub Desktop.
Save huangjs/2952481 to your computer and use it in GitHub Desktop.
socketstream with HTTPS doesn't work
var port = process.env.HTTP_PORT || 3000
, securePort = process.env.HTTPS_PORT || 3443
var httpsOptions = {
key: fs.readFileSync('./cert/private.key.insecure').toString()
, cert: fs.readFileSync('./cert/public.cert').toString()
};
// Start web server
var server = http.createServer(ss.http.middleware)
, secureServer = https.createServer(httpsOptions, ss.http.middleware);
server.listen(port);
secureServer.listen(securePort);
// Start SocketStream
ss.start(server);
ss.start(secureServer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment