打洞伺服器
(一)安裝必備軟體
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/
(六)搭建完成測試下
我與加濕器視訊了一下。