zoukankan      html  css  js  c++  java
  • 为WebRTC 应用部署Turn Server

     更多内容 https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html#centos

    从 http://turnserver.open-sys.org/downloads/  下载最新版对应你的操作系统的Turnserver  服务器安装包

    下载后解压 使用以下命令安装 rpm包 

    rpm -ivh turnserver-xxxx.rpm

    如遇缺少权限 使用 su root 输入密码即可 

    中途遇到缺少依赖包的问题,使用 yum insatall 安装相应的包即可

    编辑配置文件

    将extra 中的配置文件模版拷贝到/etc目录下,假设您的ip 是 1.2.3.4

    1,配置文件

    cp extra/turnserver.conf.template  /etc/turnserver.conf

    vi /etc/tunserver.conf

    修改

     listen_address = { "1.2.3.4" }

    修改 ## Daemon mode.
    daemon = true # 修改为后台服务方式

    修改带宽限制

    ## Allocation bandwidth limitation (in KBytes/s).
    ## 0 value means bandwidth quota disabled.
    bandwidth_per_allocation = 1024


    ## Restricted user bandwidth (in KBytes/s).
    ## 0 value means bandwidth limitation disabled.
    restricted_bandwidth = 0

    2,认证用户文件

    cp extra/turnusers.txt.template /etc/turnusers.txt

    vi /etc/turnusers.txt
     
    添加一行或多行认证信息格式为    用户名:密码:domain:authorized
    例如下面的行:
    700:700pass:domain.org:authorized
     
    启动服务
    $ turnserver -c /path/to/config/file #这里是配置文件地址
     
    添加完成后,就可以在webrtc 里面使用stun 和tun server 了。
    var configuration = {
      'iceServers': [
        { 'url' : 'stun:1.2.3.4'} ,

        { 'url' : ‘turn:700@1.2.3.4',credential : '700pass'}
      ]
    };

     
     
      
     
  • 相关阅读:
    JavaScript字符串转换为变量名
    python对象反射和函数反射
    android studio 更新Gradle版本方法
    【Node.js】'readline' 逐行读取、写入文件内容
    nodejs 设计模式
    MongoError: server instance in invalid state undefined 解决办法
    nodejs对mongodb数据库的增删改查操作(转载)
    JSON详解
    mac 安装python3
    Oracle_安装说明
  • 原文地址:https://www.cnblogs.com/Qbit/p/6025384.html
Copyright © 2011-2022 走看看