1.1. 准备 Linux 操作系统(建议Ubuntu 18.04.2 LTS)
1.2. 下载当前操作系统适用的 turnserver-3.2.3.95
$ sudo apt install openssl openssl-devel openssl-libs libevent libevent-devel
...
$ cd turnserver-3.2.3.95/
$ ./configure
...
$ sudo make && sudo make install
...
$ make
g++ multiple_test.cpp -o test
...
$ make install
pip3 install numpy
...
pip3 install matplotlib
...
$ ./test -h
Usage: ./test [Flags] [options]
Flags:
-h <help> Show the usage of program 'test'.
-L <license> Show the license.
Options:
-t <total> Total number of connection.
-m <number> Number of clients per connection.
-n <number> Number of messages to send (default: 5) per client.
-I <number> Message length.
-e <ip> Peer address.
-A <ip> TURN server address.
-f <folder> A new folder to store data (default: yy-mm-dd/).
-c <execute> Direction of the executable file (default: ./turnutils_uclient).
-s <sleep> Rand (10 ~ 20) * s as time of sleep after socket error (default: 10 s).
...
$ ./turnserver -h
Usage: turnserver [options]
Options:
-d, --listening-device <device-name> Listener interface device (NOT RECOMMENDED. Optional, Linux only).
-p, --listening-port <port> TURN listener port (Default: 3478).
Note: actually, TLS & DTLS sessions can connect to the "plain" TCP & UDP port(s), too,
if allowed by configuration.
--tls-listening-port <port> TURN listener port for TLS & DTLS listeners
(Default: 5349).
Note: actually, "plain" TCP & UDP sessions can connect to the TLS & DTLS port(s), too,
if allowed by configuration. The TURN server
...
$ ifconfig
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.17.8 netmask 255.255.248.0 broadcast 192.168.23.255
inet6 fe80::3536:4696:62d0:5faa prefixlen 64 scopeid 0x20<link>
ether a0:c5:89:fd:14:de txqueuelen 1000 (Ethernet)
RX packets 427877 bytes 51943409 (51.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12891 bytes 3270299 (3.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
红色边框内为 server 的IP地址,黄色边框内为 peer 的IP地址
$ make server
$ make peer
$ make peer