webrtc(coturn服務器搭建)


coturn服務器安裝

1下載並安裝libevent-2.0
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable && ./configure
make && make install
2下載編譯安裝coturn
git clone https://github.com/coturn/coturn
cd coturn 
./configure 
make 
make install

輸入which turnserver,如果打印出路徑,說明安裝成功

3 配置coturn
使用turnadmin生成安全訪問密碼
turnadmin -k -u username -r north.gov -p password
/usr/local/etc/turnserver.conf配置
#listening-ip與relay-ip采用內網ip,external-ip是外網的ip

listening-port=444 #監聽端口
external-ip=210.21.53.158 #外網IP
verbose
fingerprint
lt-cred-mech
realm=test
user=username:生成的加密密碼    #修改成自己的
user=username:password       #修改成自己的
stale-nonce
no-loopback-peers
no-multicast-peers
mobility
no-cli
4啟動coturn
turnserver -o -a
5ICE測試

https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

relay地址回來的是你的ip才算穿透成功。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM