Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

加ssl不能运行 #5

Open
AlbertTesla opened this issue Jun 21, 2016 · 1 comment
Open

加ssl不能运行 #5

AlbertTesla opened this issue Jun 21, 2016 · 1 comment

Comments

@AlbertTesla
Copy link

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
Copy link

zqzhang commented Apr 15, 2018

使用8443端口号和WSS试试

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants