接着对使用coTurn搭建的STUN/TURN服务使用turnutils_uclient程序测试其TURN服务是否正常。

直接连接服务测试服务是否正常。为保证测试使用的服务是TURN服务,在TURN服务启动时,关掉STUN服务。

在TURN服务启动时,如果是命令行,加入"--no-stun"配置;如果使用配置文件的话,加入"no-stun"选项。

使用coTurn服务启动TURN服务后,执行以下命令即可:

turnutils_uclient -v -t -T -u test1 -w 1234 61.18.11.123

其中

-v 表示给出详细提示

-t 使用TCP协议(默认使用UDP)

-T TCP协议中继传输(默认是UDP)

-u TURN的用户名

-w TURN服务对应用户的密码

61.18.11.123 TURN服务的IP地址

执行结果如下:  

 : IPv4. Connected from: 192.168.2.222:
: IPv4. Connected to: 61.18.11.123:
: allocate sent
: allocate response received:
: allocate sent
: allocate response received:
: success
: IPv4. Received relay addr: 61.18.11.123:
: clnet_allocate: rtv=
: refresh sent
: refresh response received:
: success
: IPv4. Connected from: 192.168.2.222:
: IPv4. Connected to: 61.18.11.123:
: IPv4. Connected from: 192.168.2.222:
: IPv4. Connected to: 61.18.11.123:
: allocate sent
: allocate response received:
: allocate sent
: allocate response received:
: success
: IPv4. Received relay addr: 61.18.11.123:
: clnet_allocate: rtv=
: refresh sent
: refresh response received:
: success
: allocate sent
: allocate response received:
: allocate sent
: allocate response received:
: success
: IPv4. Received relay addr: 61.18.11.123:
: clnet_allocate: rtv=
: refresh sent
: refresh response received:
: success
: create perm sent: 61.18.11.123:
: cp response received:
: success
: create perm sent: 61.18.11.123:
: cp response received:
: success
: tcp connect sent
: connection bind sent
: connect bind response received:
: success
: IPv4. TCP data network connected to: 61.18.11.123:
: connection bind sent
: connect bind response received:
: success
: IPv4. TCP data network connected to: 61.18.11.123:
: Total connect time is
: connections are completed
: start_mclient: msz=, tot_send_msgs=, tot_recv_msgs=, tot_send_bytes ~ , tot_recv_bytes ~
: start_mclient: msz=, tot_send_msgs=, tot_recv_msgs=, tot_send_bytes ~ , tot_recv_bytes ~
: start_mclient: msz=, tot_send_msgs=, tot_recv_msgs=, tot_send_bytes ~ , tot_recv_bytes ~
: start_mclient: msz=, tot_send_msgs=, tot_recv_msgs=, tot_send_bytes ~ , tot_recv_bytes ~
: done, connection 0x600051970 closed.
: done, connection 0x600072160 closed.
: start_mclient: tot_send_msgs=, tot_recv_msgs=
: start_mclient: tot_send_bytes ~ , tot_recv_bytes ~
: Total transmit time is
: Total lost packets (0.000000%), total send dropped (0.000000%)
: Average round trip delay 128.400000 ms; min = ms, max = ms
: Average jitter 47.600000 ms; min = ms, max = ms

参考:

http://uniray7-blog.logdown.com/posts/259368-install

04-30 06:02