我使用的是 Ubuntu 14.04(实际上是 Azure VPS),所以我必须安装 rfc5766-turn-server 而不是最新的 coturn 版本。我已遵循本指南。
在最后一步,我无法启动 turnserver。我的启动命令:
turnserver -n -L <my_server_public_IP> -X <my_server_public_IP> -E <my_server_public_IP> -a -f -r my-domain.com --cert /myPath/TurnServerCerts/turnserver.crt --pkey /myPath/TurnServerCerts/turnserver.key
我从日志中得到:
........
bind: Cannot assign requested address
0: Trying to bind fd 14 to <my_server_public_IP:3478>: errno=99
Cannot bind local socket to addr: Cannot assign requested address
0: Cannot bind UDP/DTLS listener socket to addr <my_server_public_IP:3478>:3478
0: Trying to bind UDP/DTLS listener socket to addr <my_server_public_IP:3478>:3478, again...
0: Trying to bind fd 15 to <my_server_public_IP:3478>: errno=99
Cannot bind local socket to addr: Cannot assign requested address
........
我已经尝试从命令中删除监听 IP(-L 参数),然后 turnserver 可以启动。但是,在这种情况下,turnserver 只会监听本地 IP 地址。我怎样才能让它监听公共 IP 地址?