配置stun服务器实现穿墙
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服务器实现穿墙的更多相关文章
- asp.net core 简单部署之FTP配置(CentOS 7.0安装配置Vsftp服务器)
配置过程原文地址:http://www.osyunwei.com/archives/9006.html 坑和结果 正确的跟着这个内容走,是靠谱的. 我自己给自己踩了个坑,请参照文章的朋友注意第七条:七 ...
- 7、二种 为二个不同的子网配置DHCP服务器(中继代理服务器)
环境如下: (参考之前,保证二个子网可以互相ping通) 虚拟机vm1 192.168.170.3 VMnet8 (NAT模式) 虚拟 ...
- CentOS 7.0安装配置Vsftp服务器
一.配置防火墙,开启FTP服务器需要的端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop fi ...
- 手把手教你玩转nginx负载均衡(五)----配置后端服务器组
引言 在前面几篇中,我们成功的搭建起了一台nginx服务器,所以我们要重复前面的步骤,把服务器的数量增加到3台以上,我这里已经建好了另外两台,分别是centos7-22,centos7-23,对应的i ...
- CentOS 7.2 安装配置Samba服务器
1背景 转Linux刚刚1年,vim操作还不能应对工程代码,之前一直都是Gnome桌面 + Clion 作开发环境,无奈在服务器上没有这样的环境, 看同事是(Windows)Source Insigh ...
- CentOS 6.6安装配置LAMP服务器(Apache+PHP5+MySQL)
准备篇: CentOS 6.6系统安装配置图解教程 http://www.osyunwei.com/archives/8398.html 1.配置防火墙,开启80端口.3306端口 vi /etc/s ...
- CentOS 6.5 yum安装配置lnmp服务器(Nginx+PHP+MySQL)
以下全部转载于 http://blog.csdn.net/lane_l/article/details/20235909 本人于今晚按照该文章使用centos 6.7 64bit安装成功,做个备份, ...
- zend studio 配置 apache服务器事宜
安装好 zend studio后,配置 apache服务器时,设置 configuration directory时,需选中 xampp\apache里面的 conf 文件夹,即完整的路径为: *\x ...
- CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)
CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL) 一.准备篇: /etc/init.d/iptables stop #关闭防火墙 关闭SELINUX vi /etc/sel ...
随机推荐
- Can't zip RDDs with unequal numbers of partitions
java.lang.IllegalArgumentException: Can't zip RDDs with unequal numbers of partitions //如果两个RDD分区数不同 ...
- [Linux]Linux应用程序中添加强制中断处理
注册Ctrl+C的按键signal信号捕捉,在捕捉到该动作后,强制退出应用程序 void handle_sig(int num) { printf( "%s\n", __func_ ...
- udp program
UDP program UDP常用函数:recvfrom和sendto recvfrom ssize_t recvfrom(int sockfd, void *buf, size_t len, int ...
- 二、thinkphp
## ThinkPHP 3.1.2 查询方式#讲师:赵桐正微博:http://weibo.com/zhaotongzheng 本节课大纲:一.普通查询方式 a.字符串 $arr=$m->wher ...
- 【转】【iOS测试系列】常用测试小插件的使用
背景介绍 由于iOS系统的限制,在非越狱的自动化测试中无法实现一些常用的功能,比如不同应用之间来回切换.模拟全局的点击事件等等.但是在越狱的环境下,这些限制就不存在了,我们可以利用各种小插件来实现我们 ...
- C++ 引用本质的详解
//引用本质的理解① #include<iostream> using namespace std; int GetA(){ ; return a; } int & GetB(){ ...
- Mybatis实现了接口绑定,使用更加方便。
1.Mybatis实现了接口绑定,使用更加方便. 在ibatis2.x中我们需要在DAO的实现类中指定具体对应哪个xml映射文件, 而Mybatis实现了DAO接口与xml映射文件的绑定,自动为我们生 ...
- 如果输入参数采用“指针传递”,那么加 const 修饰可以防止意外地改动该指针,起 到保护作用
如果输入参数采用“指针传递”,那么加 const 修饰可以防止意外地改动该指针,起 到保护作用. #include <iostream> /* run this program using ...
- COCOS2D-X多层单点触摸分发处理方案?
如今的问题是点击button的时候,会触发底层的触摸事件,怎么不触发底层的触摸事件啊?
- angularJs 多文件动态上传(删除其中一个文件的时候,要么file没被删除,要么删除了之后,点击事件失效)
<div cacModule.controller('CacScriptEditCtrl', CacScriptEditCtrl); CacScriptEditCtrl.$inject = [' ...