rexxars/sse-channel

Not working on https?

turbo5 opened this issue · 1 comments

My events stopped propagating recently, still investigating the possible reasons.
I just changed everything to https-only, can that be the problem? Can this sse channel work on https, and if so, how do I setup that way?
I'm on 2.0.5
Thank you!

Here's how you get ssl working:
in examples/express/server.js replace

app.listen(port, function() {
    console.log('Listening on http://localhost:%s/', port);
});`

with:

var https = require('https');
var fs = require('fs');
var options = {
//  ca: [fs.readFileSync(PATH_TO_BUNDLE_CERT_1), fs.readFileSync(PATH_TO_BUNDLE_CERT_2)],//if needed
  cert: fs.readFileSync('/pathto/ssl.cert'),
  key: fs.readFileSync('/pathto/ssl.key')
};

var server = https.createServer(options, app);

server.listen(port, function(){
	console.log('Listening on https://localhost:%s/', port)
});