Hello,
Here are more details about what I've done so far.
I followed the tutorial to setup websocket to WSS.
When I start KMS, I see that listening correctly on the port 8433. I also checked with wscat and the websocket server is accessible. Note that I use the -n options as I don't present any certificate with this test.
matth$
wscat --connect wss://192.168.130.3:8433 -nconnected (press CTRL+C to quit)
disconnected
When I start the hello world tutorial it's working. The page is accessible with HTTP and I can see with TCPDUMP that the connection to websocket is using the WSS port ( 8433 ).
Now I try to set SSL on the server node js Here is what I've try to do in the server.js :
change : as_uri from http to https and change the port to 8443. Use 'fs' to initiate set the cert and change the "server" variable in order to use SSL. :
....
var path = require('path');
var fs = require('fs');var express = require('express');
var minimist = require('minimist');
var url = require('url');
var kurento = require('kurento-client');
var argv = minimist(process.argv.slice(2),
{
default:
{
as_uri: "
https://xx.xx.xx.xx:8443/",
ws_uri: "
wss://xx.xx.xx.xx:8433/kurento"
}
});
var app = express();
var https = require('https');var bodyParser = require('body-parser');
app.use(bodyParser.text({type : 'application/sdp'}));
var pipeline = null;
var asUrl = url.parse(argv.as_uri);
var port = asUrl.port;
var options = {
key: fs.readFileSync('/etc/kurento/server.key'),
cert: fs.readFileSync('/etc/kurento/server.crt'),
requestCert: true,
passphrase: ""
};....
.....
Here the creation of the server :
var server = https.createServer(options, app).listen(port, function() {
console.log('Kurento Tutorial started');
console.log('Open ' + url.format(asUrl) + ' with a WebRTC capable browser');
});*/ instead of
// var server = app.listen(port, function() {
// console.log('Kurento Tutorial started');
// console.log('Open ' + url.format(asUrl) + ' with a WebRTC capable browser');
});*/
When I start the server with npm start I don't have errors, I can also see we lsof / netstat that the node js is listening on the port 8443. The page is accessible with HTTPS. But when I click on the bottom start, I have a problem when the index.js is submitting the "POST" REST ( HTTP ) command to 'helloword' and create a problem of "cross domain".
See the attachment showing the error in the console.
If by any chance you have an idea how to solve that.
Thank you by advance.