请教各位大神,nodejs 与 socket.io 长连接之间的信息交互如何通过SSL加密?
var https = require(‘https’); var fs = require(‘fs’);
var options = { key: fs.readFileSync(‘test/fixtures/keys/agent2-key.pem’), cert: fs.readFileSync(‘test/fixtures/keys/agent2-cert.pem’) };
https.createServer(options, function (req, res) { res.writeHead(200); res.end(“hello world\n”); }).listen(8000);
这种应该不行吧 ? 界面上socket.io又如何去加载证书?