The signal server of hlsjs-p2p-engine
git clone https://github.com/cdnbye/gosignaler.git
go get github.com/gorilla/websocket
cd gosignaler && make
Upload binary file to server, create cert
directory with crt.pem
and crt.key
, then start service:
chmod +x admin.sh
./admin.sh start
import Hls from 'cdnbye';
var hlsjsConfig = {
p2pConfig: {
wsSignalerAddr: 'ws://YOUR_SIGNAL',
// Other p2pConfig options provided by hlsjs-p2p-engine
}
};
// Hls constructor is overriden by included bundle
var hls = new Hls(hlsjsConfig);
// Use `hls` just like the usual hls.js ...
git clone https://github.com/cdnbye/gosignaler.git
go get github.com/gorilla/websocket
cd gosignaler && make
将编译生成的二进制文件上传至服务器,并在同级目录创建cert
文件夹,将证书和秘钥文件分别改名为crt.pem
和crt.key
放入cert,之后启动服务:
chmod +x admin.sh
./admin.sh start
import Hls from 'cdnbye';
var hlsjsConfig = {
p2pConfig: {
wsSignalerAddr: 'ws://YOUR_SIGNAL',
// Other p2pConfig options provided by hlsjs-p2p-engine
}
};
// Hls constructor is overriden by included bundle
var hls = new Hls(hlsjsConfig);
// Use `hls` just like the usual hls.js ...