Turn服务器的配置流程

Webrtc是基于P2P的,在两个客户端建立连接之前需要服务器建立连接,这时两台设备一般都处于一个或者多个NAT中,那么两台设备建立连接就需要穿墙技术。

这时就用到了turn服务器,他包括stun服务器,stun服务器主要用来获得外网的地址,而turn服务器则负责在P2P连接失败时进行转发

推荐一个部署turn服务器的方式,下载地址https://github.com/coturn/coturn

下载完成以后进行安装,cd到下载coturn的目录下

执行./configure

make

make install

执行时会报错Libevent2 development is not installed properly

ERROR: Libevent2 development libraries are not installed properly in required location.

ERROR: may be you have just too old libevent tool - then you have to upgrade it.

See the INSTALL file.

说明你需要安装libevent,以ubuntu为例执行命令进行安装sudo apt-get install libevent-dev

如果执行成功会在conturn的bin目录下生成一些文件

配置iceServer

turnserver -o -a -f -v --mobility -m 10 --max-bps=100000 --min-port=32355 --max-port=65535 --user=username1:password1 --user=username2:password2 -r demo –m 10

其中username1和username2分配了两个不同的账号和密码

在服务器内的配置

webrtc的服务器一般使用SkyRTC,下载地址https://github.com/LingyuCoder/SkyRTC-demo

下载后按照文档进行安装和配置

配置stun需要在SkyRTC-client.js

内配置iceServers,配置的端口默认是3478,格式如下

“url“: 'stun:ip:3478'

“username”: 'username1’

“password”:’password1’

配置stun服务器实现穿墙的更多相关文章

  1. asp.net core 简单部署之FTP配置(CentOS 7.0安装配置Vsftp服务器)

    配置过程原文地址:http://www.osyunwei.com/archives/9006.html 坑和结果 正确的跟着这个内容走,是靠谱的. 我自己给自己踩了个坑,请参照文章的朋友注意第七条:七 ...

  2. 7、二种 为二个不同的子网配置DHCP服务器(中继代理服务器)

    环境如下:        (参考之前,保证二个子网可以互相ping通) 虚拟机vm1        192.168.170.3                    VMnet8 (NAT模式) 虚拟 ...

  3. CentOS 7.0安装配置Vsftp服务器

    一.配置防火墙,开启FTP服务器需要的端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop fi ...

  4. 手把手教你玩转nginx负载均衡(五)----配置后端服务器组

    引言 在前面几篇中,我们成功的搭建起了一台nginx服务器,所以我们要重复前面的步骤,把服务器的数量增加到3台以上,我这里已经建好了另外两台,分别是centos7-22,centos7-23,对应的i ...

  5. CentOS 7.2 安装配置Samba服务器

    1背景 转Linux刚刚1年,vim操作还不能应对工程代码,之前一直都是Gnome桌面 + Clion 作开发环境,无奈在服务器上没有这样的环境, 看同事是(Windows)Source Insigh ...

  6. CentOS 6.6安装配置LAMP服务器(Apache+PHP5+MySQL)

    准备篇: CentOS 6.6系统安装配置图解教程 http://www.osyunwei.com/archives/8398.html 1.配置防火墙,开启80端口.3306端口 vi /etc/s ...

  7. CentOS 6.5 yum安装配置lnmp服务器(Nginx+PHP+MySQL)

    以下全部转载于  http://blog.csdn.net/lane_l/article/details/20235909 本人于今晚按照该文章使用centos 6.7 64bit安装成功,做个备份, ...

  8. zend studio 配置 apache服务器事宜

    安装好 zend studio后,配置 apache服务器时,设置 configuration directory时,需选中 xampp\apache里面的 conf 文件夹,即完整的路径为: *\x ...

  9. CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)

    CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL) 一.准备篇: /etc/init.d/iptables stop #关闭防火墙 关闭SELINUX vi /etc/sel ...

随机推荐

  1. udp program

    UDP program UDP常用函数:recvfrom和sendto recvfrom ssize_t recvfrom(int sockfd, void *buf, size_t len, int ...

  2. ansible IP

    问题解决了,用IP: "{{ ansible_eth0'ipv4' }}" 而不是{{ansible_all_ipv4_addresses}} 修改了之后的playbook 如下: ...

  3. 常见的装包的三种宝,包 bao-devel bao-utils bao-agent ,包 开发包 工具包 客户端

    常见的装包的三种宝,包  bao-devel    bao-utils   bao-agent  ,包    开发包   工具包  客户端

  4. 微信小程序 - mixins

    mixins 概念 可百度  参考 http://ask.seowhy.com/article/21007 大意和Python中的多重继承, java中的接口类似(java接口只是定义,实现需要子类自 ...

  5. ngx_lua 随笔

    --[[ test --]] ngx.header.content_type = "text/plain"; --输出头部 local user = ngx.var.arg_use ...

  6. WEB 项目中JAVA取得WEBROOT物理路径

    http://wwwzhouhui.iteye.com/blog/504330 ———————————————————————————————————————————————————————————— ...

  7. Python之打印变量

    def myprint(v): print v print type(v) try: print v.shape except: try: print len(v) except: pass

  8. TensorFlow基础笔记(8) TensorFlow简单人脸识别

    数据材料 这是一个小型的人脸数据库,一共有40个人,每个人有10张照片作为样本数据.这些图片都是黑白照片,意味着这些图片都只有灰度0-255,没有rgb三通道.于是我们需要对这张大图片切分成一个个的小 ...

  9. iScroll框架解析——Android 设备页面内 div(容器,非页面)overflow:scroll; 失效解决(转)

    移动平台的活,兼容问题超多,今儿又遇到一个.客户要求在弹出层容器内显示内容,但内容条数过多,容器显示滚动条.按说是So easy,容器设死宽.高,CSS加属性 overflow:scroll; -we ...

  10. hdu 1140:War on Weather(计算几何,水题)

    War on Weather Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)To ...