搭建coturn服务器

搭建coturn服务器

  • 环境准备
  • 文件配置
  • 启动
  • 测试

环境准备

(1)准备一台云服务器,安装Ubuntu18.04操作系统
(2)安装coturn

sudo apt install coturn 

文件配置

配置文件位置

/etc/turnserver.conf

修改内容:

listening-port=3478
external-ip=49.233.183.129
realm= 网址
user=用户名:key
或
user=用户名:密码

启动

turnserver 

结果入下:

0: log file opened: /var/tmp/turn_29200_2020-04-17.log
0: 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.0.7 'dan Eider'
0: 
Max number of open files/sockets allowed for this process: 1048576
0: 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
0: 

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 supported


..........
..........
..........


0: Wait for relay ports initialization...
0:   relay 172.21.0.4 initialization...
0:   relay 172.21.0.4 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: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: Total General servers: 2
0: IO method (admin thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: SQLite DB connection success: /var/lib/turn/turndb

测试

打开测试网址:

https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

搭建coturn服务器_第1张图片

你可能感兴趣的:(物联网)