我正在尝试在 Google Cloud Ubuntu 实例中运行 Coturn。
在新安装的虚拟机中使用: sudo apt install coturn
我用私钥创建了一个证书文件并更新了/etc/turnserver.conf:
listening-port=3478
tls-listening-port=5349
listening-ip=10.128.0.2
relay-ip=10.128.0.2
external-ip=35.192.224.52/10.128.0.2
lt-cred-mech
userdb=/var/lib/turn/turndb
user=attitudemarketing:password
cert=cert.crt
pkey=private.key
no-stdout-log
一切似乎都在运行,但是当我尝试 Trickle Ice 时:https ://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/它似乎没有工作
这是来自 coturn 的日志文件:
0: log file opened: /var/log/turn_1978_2017-10-12.log
0: pid file created: /var/run/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: Wait for relay ports initialization...
0: relay 10.128.0.2 initialization...
0: relay 10.128.0.2 initialization done
0: relay ::1 initialization...
0: relay ::1 initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=1 created
0: IPv4. TCP listener opened on : 127.0.0.1:3478
0: IPv4. TCP listener opened on : 127.0.0.1:3479
0: IPv4. TCP listener opened on : 10.128.0.2:3478
0: IPv4. TCP listener opened on : 10.128.0.2:3479
0: IPv6. TCP listener opened on : ::1:3478
0: IPv6. TCP listener opened on : ::1:3479
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: IPv4. TCP listener opened on : 127.0.0.1:3478
0: IPv4. TCP listener opened on : 127.0.0.1:3479
0: IPv4. TCP listener opened on : 10.128.0.2:3478
0: IPv4. TCP listener opened on : 10.128.0.2:3479
0: IPv6. TCP listener opened on : ::1:3478
0: IPv6. TCP listener opened on : ::1:3479
0: IPv4. UDP listener opened on: 127.0.0.1:3478
0: IPv4. UDP listener opened on: 127.0.0.1:3479
0: IPv4. UDP listener opened on: 10.128.0.2:3478
0: IPv4. UDP listener opened on: 10.128.0.2:3479
0: IPv6. UDP listener opened on: ::1:3478
0: IPv6. UDP listener opened on: ::1:3479
0: Total General servers: 2
0: IO method (auth thread): epoll (with changelist)
0: IO method (admin thread): epoll (with changelist)
0: IPv4. CLI listener opened on : 127.0.0.1:5766
0: IO method (auth thread): epoll (with changelist)
0: SQLite DB connection success: /var/lib/turn/turndb
我不确定它是否正常工作,或者是否因为它位于 Google 云虚拟机内部而被阻止。