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
git clone https://github.com/coturn/coturn cd coturn ./configure make make install
輸入which turnserver,若是打印出路徑,說明安裝成功git
使用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
turnserver -o -a
https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/github
relay地址回來的是你的ip纔算穿透成功。web