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