WebRTC搭建流程(三)打洞伺服器
阿新 • • 發佈:2018-12-22
打洞伺服器
(一)安裝必備軟體
sudo apt-get install libssl-dev
sudo apt-get install libsqlite3
sudo apt-get install libsqlite3-dev
sudo apt-get install libpq-dev
sudo apt-get install libevent-dev
(二)git下載打洞伺服器倉庫
cd ~
git clone https://github.com/coturn/coturn.git
(三)安裝
cd coturn ./configure make make install cp ./examples/etc/turn* ./bin/ cd bin/ mv turnserver.conf turnserver.conf.bak //備份
(四)啟動
nohup ./coturn/bin/turnserver --syslog -a -L 內網ip -X 外網ip -E 內網ip -f --min-port=32355 --max-port=65535 --user=helloword:helloword -r helloword --cert=turn_server_cert.pem --pkey=turn_server_pkey.pm --log-file=stdout -v > ./logs/turn.log 2>&1 &
(五)驗證是否成功
- 日誌
tail -f ./logs/turn.log
- 開啟網頁
能開啟就沒問題
http://外網ip:3478/
-google打洞驗證
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/