0%
  
  
  
    
  
  
  
  
    
    
      
      
      
    
    
      
    
      
    
    
    
    
        deepin/ubuntu 环境。
安装 coturn
先安装依赖:
| 1
 | apt-get install libssl-dev libevent-dev
 | 
然后下载 coturn:
| 1
 | git clone https://github.com/coturn/coturn.git
 | 
安装:
| 12
 3
 
 | ./configure --prefix=/usr/local/coturnsudo make
 sudo make install
 
 | 
配置环境变量:
| 12
 3
 4
 5
 6
 7
 
 | vim ~/.bashrc
 添加以下内容:
 export coturn_home=/usr/local/coturn
 export PATH=$PATH:$coturn_home/bin
 
 source ~/.bashrc
 
 | 
修改配置文件
| 12
 3
 
 | sudo cp /usr/local/coturn/etc/turnserver.conf.default /usr/local/coturn/turnserver.conf
 sudo vim /usr/local/coturn/turnserver.conf
 
 | 
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 
 | #(必选)监听端口可以不设置会默认的使用3478listening-port=3478
 #(必选)监听的网卡
 listening-device=eth0
 #(必选)listening-ip,注意必须是你的内网IP地址
 listening-ip=10.0.0.76
 #(必选)external-ip,注意必须使用你的外网IP地址(云主机的公网IP地址)
 external-ip=
 #(必选)设置用户名及密码
 user=root:123456
 cli-password=123456
 #(必选)一般和你创建用户名和密码是填写的-r后面的一样
 realm=外网 ip 或域名
 min-port=49152
 max-port=65535
 lt-cred-mesh
 # 证书
 cert=
 pkey=
 
 | 
启动
| 1
 | turnserver -a -o -c /usr/local/coturn/turnserver.conf
 | 
iceServer 写成: