LingyuCoder / SkyRTC-demo

A simple demo used SkyRTC
671 stars 306 forks source link

加ssl不能运行 #5

Open AlbertTesla opened 8 years ago

AlbertTesla commented 8 years ago
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稍微改了一下,但是就运行不了,什么报错也没有,能帮我看看嘛。 非常感谢

zqzhang commented 6 years ago

使用8443端口号和WSS试试

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