Changed this so I could use a self-signed certificate with wss://. Here is a code snippet:
// CLIENT
swarm_host = new swarm.Host(config.get('client_id'));
var url = 'wss://' + config.get('local_server');
var opts = { ca: [pem.server_cert] };
swarm_host.connect(url, opts); // TODO: passing opts.ca requires modifications to Swarm
swarm.env.localhost = swarm_host;
// SERVER
var https_server = https.createServer({
cert: pem.server_cert,
key: pem.server_key,
});
https_server.listen(port, function (err) {});
var wss_server = new ws.Server({ server: https_server });
wss_server.on('connection', function (ws) {});
Changed this so I could use a self-signed certificate with
wss://
. Here is a code snippet: