1、下載coturn源碼
git clone https://github.com/coturn/coturn.git
2、進入到coturn路徑下,執(zhí)行一下命令。
./configure
出現(xiàn)以下錯誤:
問題1:ERROR: OpenSSL Crypto development libraries are not installed properly in required location.
解決辦法:sudo apt-get install libssl-dev 執(zhí)行此命令安裝libssl
問題2:Libevent2 development libraries are not installed properly in required location.
解決辦法:sudo apt-get install libssl-dev libevent-dev
出現(xiàn)以下界面說明./configure執(zhí)行成功。
3、執(zhí)行make,進行編譯。出現(xiàn)以下界面則編譯成功。
3、執(zhí)行make install 安裝。出現(xiàn)以下界面則安裝成功。
4、服務器配置
#與前ifconfig查到的網(wǎng)卡名稱一致(如果無法運行ifconfig,可以在windows的cmd窗口中使用ipconfig,如果只有一塊網(wǎng)卡,可以默認使用如下值)
relay-device=eth0
#內(nèi)網(wǎng)IP(ipconfig查到的IP地址)
listening-ip=192.168.1.188
#公網(wǎng)IP(局域網(wǎng)可以使用與上面相同的ip地址)
external-ip=113.119.27.xx
#第1步創(chuàng)建的用戶名密碼,創(chuàng)建IceServer時用
user=your_username:your_password
#一般與turnadmin創(chuàng)建用戶時指定的realm一致
realm=xxx.com
#端口號
listening-port=3478
#不開啟會報CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!錯誤
cli-password=qwerty
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
8、部署STURN服務
turnserver -v -r xxx.xxx.xxx.xxx(公網(wǎng)ip):3478 -a -o -c turnserver.conf
6、查看是否啟動
sudo lsof -i:3478
7、關閉STURN服務
kill -9 <pid>
8、測試
Trickle ICE (webrtc.github.io)
文章來源:http://www.zghlxwxcb.cn/news/detail-738819.html
參考鏈接:https://blog.csdn.net/lepaitianshi/article/details/123778506文章來源地址http://www.zghlxwxcb.cn/news/detail-738819.html
到了這里,關于Linux中搭建coturn服務器的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!