LingyuCoder/SkyRTC-demo

加ssl不能运行

AlbertTesla opened this issue · 1 comments

var express = require('express');
var app = express();
var path = require("path");
const fs = require('fs');
var options = {
    key: fs.readFileSync('./privatekey.pem'),
    cert: fs.readFileSync('.server.pem')
};
var server = require('https').createServer(options, app);
var SkyRTC = require('skyrtc').listen(server);

var port = process.env.PORT || 80;
server.listen(port);

你好,我在本地见了一个demo,别人访问谷歌提示说要加ssl,我现在把server.js稍微改了一下,但是就运行不了,什么报错也没有,能帮我看看嘛。
非常感谢

使用8443端口号和WSS试试

//连接WebSocket服务器
  rtc.connect("wss:" + window.location.href.substring(window.location.protocol.length).split('#')[0], window.location.hash.slice(1));