2017-10-12 36 views
1

我试图在Google云Ubuntu实例中运行Coturn。 sudo易于安装coturn在Ubuntu的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 

一切都显得

在一个新的虚拟机使用安装coturn运行,但是当我尝试涓流冰: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云虚拟机内部存在而被阻止。

+0

我想你需要打开防火墙上的端口。尝试打开端口3478和5349 [使用以下说明](https://stackoverflow.com/questions/21065922/how-to-open-a-specific-port-such-as-9090-in-google-compute-发动机)。 – Kyle

回答

2

我最近在AWS Ubuntu EC2实例上设置了一个coturn服务器。该过程对于Google Cloud Instance应该是相同的。

首先,请确保以下入站端口被打开(TCP & UDP):

  • 3478和3479(标准监听端口和监听的端口)
  • 5349和5350(标准TLS-监听端口和替代TLS-监听端口)
  • 49152 - 65535(标准中继端口)

为了进行测试,直到你的服务器可达,ID广告d以下的turnserver.conf:

no-tls 
no-dtls 
verbose 

一般情况下,你还需要添加fingerprint到你的配置。

对于这些的说明,请检查this。现在,我还会从您的配置中删除cert=cert.crtpkey=private.key

此时,您应该能够从远程计算机访问您的服务器。测试这个最好的方法通常是去远程机器的浏览器,然后转到“your-public-ip”:3478。

如果服务器可达,你应该看到在浏览器中执行以下操作:

pic

如果没有,请尝试以下操作:

  • 删除听-IP,继电器-IP ,external-ip和监听端口,并让coturn自行决定(这适用于AWS EC2上的我)

  • 将监听端口设置为80,将监听端口设置为443,并打开服务器上的端口。这将有助于防范非常严格的防火墙,但我认为这不应该是Google VM上的问题。