janus部署

配置和运行janus

1. 配置nginx

安装nginx,主要用来提供web访问。

生成证书

mkdir -p ~/cert
cd ~/cert
# CA私钥
openssl genrsa -out key.pem 2048
# 自签名证书
openssl req -new -x509 -key key.pem -out cert.pem -days 1095

安装nginx

#下载nginx 1.15.8版本
wget http://nginx.org/download/nginx-1.15.8.tar.gz
tar xvzf nginx-1.15.8.tar.gz
cd nginx-1.15.8/# 配置,一定要支持https
./configure --with-http_ssl_module # 编译
make#安装
sudo make install 

修改nginx配置文件

/usr/local/nginx/conf/nginx.conf
指向janus所在目录/opt/janus/share/janus/demos

# HTTPS serverserver {listen       443 ssl;server_name  localhost;# 配置相应的keyssl_certificate      /root/cert/cert.pem;ssl_certificate_key  /root/cert/key.pem;ssl_session_cache    shared:SSL:1m;ssl_session_timeout  5m;ssl_ciphers  HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers  on;# 指向janus demo所在目录location / {root   /opt/janus/share/janus/demos;index  index.html index.htm;}}

启动nginx

然后通过
https://49.232.250.45
可以访问到界面,但此时还不能正常通话。

安装和启动coturn

sudo apt-get install libssl-dev
sudo apt-get install libevent-dev#git clone https://github.com/coturn/coturn 
#cd coturn
# 提供另一种安装方式turnserver是coturn的升级版本
wget http://coturn.net/turnserver/v4.5.0.7/turnserver-4.5.0.7.tar.gz
tar xfz turnserver-4.5.0.7.tar.gz
cd turnserver-4.5.0.7./configure 
make && sudo make install

启动

sudo nohup turnserver -L 0.0.0.0 --min-port 50000 --max-port 60000  -a -u lqf:123456 -v -f -r nort.gov &

需要在安全组开放端口:
TCP/UDP 3478
UDP 50000-60000

配置janus相关配置文件

包含janus.jcfg,janus.transport.http.jcfg,janus.transport.websockets.jcfg
注意:如果不需要http支持,则可以不配置janus.transport.http.jcfg

配置janus.jcfg

stun_server = "49.232.250.45"stun_port = 3478nice_debug = falsenat_1_1_mapping = "49.232.250.45"# credentials to authenticate...turn_server = "49.232.250.45"turn_port = 3478turn_type = "udp"turn_user = "hnb"turn_pwd = "123456"

PXL7L8P8UNYY_E{5LU8SPH.png
![FS(@QWOF%UOC2]8456(UQ@5.png

配置janus.transport.http.jcfg

general: {#events = true                                  # Whether to notify event handlers about transport events (default=true)json = "indented"                               # Whether the JSON messages should be indented (default),# plain (no indentation) or compact (no indentation and no spaces)base_path = "/janus"                    # Base path to bind to in the web server (plain HTTP only)threads = "unlimited"                   # unlimited=thread per connection, number=thread poolhttp = true                                             # Whether to enable the plain HTTP interfaceport = 8088                                             # Web server HTTP port#interface = "eth0"                             # Whether we should bind this server to a specific interface only#ip = "192.168.0.1"                             # Whether we should bind this server to a specific IP address (v4 or v6) onlyhttps = true                                    # Whether to enable HTTPS (default=false)secure_port = 8089                              # Web server HTTPS port, if enabled#secure_interface = "eth0"              # Whether we should bind this server to a specific interface only#secure_ip = "192.168.0.1"              # Whether we should bind this server to a specific IP address (v4 or v6) only#acl = "127.,192.168.0."                # Only allow requests coming from this comma separated list of addresses
}certificates: {cert_pem = "/root/cert/cert.pem"cert_key = "/root/cert/key.pem"#cert_pwd = "secretpassphrase"#ciphers = "PFS:-VERS-TLS1.0:-VERS-TLS1.1:-3DES-CBC:-ARCFOUR-128"
}

配置janus.transport.websockets.jcfg

general: {#events = true                                  # Whether to notify event handlers about transport events (default=true)json = "indented"                               # Whether the JSON messages should be indented (default),# plain (no indentation) or compact (no indentation and no spaces)#pingpong_trigger = 30                  # After how many seconds of idle, a PING should be sent#pingpong_timeout = 10                  # After how many seconds of not getting a PONG, a timeout should be detectedws = true                                               # Whether to enable the WebSockets APIws_port = 8188                                  # WebSockets server port#ws_interface = "eth0"                  # Whether we should bind this server to a specific interface only#ws_ip = "192.168.0.1"                  # Whether we should bind this server to a specific IP address onlywss = true                                              # Whether to enable secure WebSocketswss_port = 8989                         # WebSockets server secure port, if enabled#wss_interface = "eth0"                 # Whether we should bind this server to a specific interface only#wss_ip = "192.168.0.1"                 # Whether we should bind this server to a specific IP address only#ws_logging = "err,warn"                # libwebsockets debugging level as a comma separated list of things# to debug, supported values: err, warn, notice, info, debug, parser,# header, ext, client, latency, user, count (plus 'none' and 'all')#ws_acl = "127.,192.168.0."             # Only allow requests coming from this comma separated list of addresses
}certificates: {cert_pem = "/root/cert/cert.pem"cert_key = "/root/cert/key.pem"#cert_pwd = "secretpassphrase"
}

修改网页默认支持的wss协议

修改 /opt/janus/share/janus/demos/videoroomtest.js文件
将默认的https协议改为wss

var server = "wss://" + window.location.hostname + ":8989";

T08VJUVSB(1O3X}F@73Q6$4.png
端口开放
tcp:8088,8089,8188,8989,3478,80,443
udp:3478,50000-60000

错误问题解决

[ERR] [dtls.c:janus_dtls_srtp_incoming_msg:923] [7071685807055874] Oops, error creating inbound SRTP session for component
先查找libsrtp2.so

ubuntu@VM-0-17-ubuntu:~/webrtc/libsrtp$ sudo locate libsrtp2.so
/home/ubuntu/webrtc/libsrtp/libsrtp2.so
/home/ubuntu/webrtc/libsrtp/libsrtp2.so.1
/usr/lib/libsrtp2.so
/usr/lib/libsrtp2.so.1
/usr/lib/x86_64-linux-gnu/libsrtp2.so
/usr/lib/x86_64-linux-gnu/libsrtp2.so.1

把命令安装的删除

sudo rm -rf /usr/lib/x86_64-linux-gnu/libsrtp2.*
sudo ldconfig

运行 Janus

/opt/janus/bin/janus --debug-level=5 --log-file=$HOME/janus-log

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/819442.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Unity AR开发环境搭建

在上一篇文章中,我定义了各种类型的扩展现实 (XR)。 在其中,我将增强现实 (AR) 定义为:增强现实 (AR) 将数字对象置于物理世界中。 通常,该设备将配备某种类型的相机(例如智能手机),可以实时提供…

Spring Task 定时任务调度

一、概念 Spring Task 是 Spring 框架的一个组件,它为任务调度提供了支持,使得开发者能够创建后台任务或定期执行的任务。通过 Spring Task,您可以方便地在 Java 应用程序中实现定时任务,比如每天凌晨进行数据同步、每小时执行一…

如何使用React.js从头开始构建TODO应用

如果你是React.js的新手,并且渴望投身应用程序开发,那么你来对地方了! 跟着我一起通过这个教程,从头开始构建一个基本的TODO应用程序。 (本文视频讲解:java567.com) TODO应用对初学者的重要性…

webSocket + springboot+vue3用法

领导安排个任务&#xff0c;大屏显示数据&#xff0c;要与后台数据一致&#xff0c;所以用到了websocket&#xff0c;涉及的前后端代码整理如下&#xff0c;希望对大家有所帮助。 后端代码 pom文件添加依赖 <!--websocket依赖--> <dependency><groupId>or…

jeecg-boot安装

我看大家都挺关注&#xff0c;所以集中上传了下代码和相关工具&#xff0c;方便大家快速完成 链接&#xff1a;https://pan.baidu.com/s/1-Y9yHVZ-4DQFDjPBWUk4-A 提取码&#xff1a;op1r 1. 下载代码 下载地址 : JEECG官方网站 - 基于BPM的低代码开发平台(低代码平台_零代…

C# 窗体应用程序 Chart控件显示实时曲线

IDE: VS2019 项目模板&#xff1a;C# windows 窗体应用(.NET Framework) 【参考】 B站上教程C#Chart控件画折线图的使用&#xff0c;关于Chart控件的属性&#xff0c;介绍得非常详细。B站上教程C#上位机Chart控件实时曲线终极讲解&#xff0c;对鼠标滚轮事件等&#xff0c;多个…

冯诺依曼结构理解

冯诺依曼结构 存储器&#xff1a;内存 数据是要在计算机的体系结构中进行流动的&#xff0c;在流动过程中对数据加工处理 从一个设备到另一个设备&#xff0c;本质是一种拷贝 CPU的计算速度是很快的&#xff0c;所以数据设备间的拷贝效率&#xff0c;决定了计算机整体的基本效率…

常见Spring相关工具报错-源码分析

常见Spring相关工具报错-源码分析 1. Resouce Bundle 国际化 yml 配置不生效 1. Resouce Bundle 国际化 yml 配置不生效 1️⃣ 配置yml 2️⃣ 报错信息 2024-04-15 15:13:57.828 [http-nio-8090-exec-1] WARN o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - [doResolveHan…

Python数据挖掘项目开发实战:使用朴素贝叶斯进行社会媒体挖掘

注意&#xff1a;本文下载的资源&#xff0c;与以下文章的思路有相同点&#xff0c;也有不同点&#xff0c;最终目标只是让读者从多维度去熟练掌握本知识点。 Python数据挖掘项目开发实战&#xff1a;使用朴素贝叶斯进行社会媒体挖掘 一、项目背景与目标 在社交媒体时代&…

Spring Boot | SpringBoot对 “SpringMVC“的 “整合支持“、SpringMVC“功能拓展实现“

目录: SpringMVC 的 “整合支持” ( 引入"Web依赖启动器"&#xff0c;几乎可以在无任何额外的配置的情况下进行"Web开发")1.SpringMVC "自动配置" 介绍 ( 引入Web依赖启动器"后&#xff0c;SpringBoot会自动进行一些“自动配置”&#xff0…

51单片机-LED模块

文章目录 1.点亮一个LED灯2.LED闪烁3.LED流水灯 1.点亮一个LED灯 #include <REGX52.H> void main() {P20xFE; //1111 1110while(1){} }2.LED闪烁 增加延时&#xff0c;控制LED的亮灭间隙 延时函数的添加依靠STC-ISP软件的延时函数功能代码自动生成&#xff0c;如图 #i…

Linux 使用C语言来加载和卸载内核模块

文章目录 一、insmod/rmmod1.1 insmod1.2 rmmod 二、C语言示例2.1 syscall2.2 dmeo 一、insmod/rmmod 1.1 insmod Linux 使用insmod来加载内核模块&#xff1a; NAMEinsmod - Simple program to insert a module into the Linux Kernel使用strace来追踪其过程&#xff1a; …

React中useEffect与useLayoutEffect有什么区别?

React中useEffect与useLayoutEffect有什么区别&#xff1f; 1. useEffect2. useLayoutEffect3. useEffect与useLayoutEffect的区别3.1 何时使用useLayoutEffect&#xff1f; 在React中&#xff0c;useEffect和useLayoutEffect都是用来处理副作用的Hook&#xff0c;例如数据获取…

童话里都是骗人的,靠可视化大屏升职加薪,除非老板脑子秀逗了。

可视化大屏有没有价值&#xff0c;肯定是有的&#xff0c;靠着可视化大屏升职加薪靠谱吗&#xff1f;不靠谱。 童话故事中的情节和元素往往是夸张和不现实的&#xff0c;不能完全应用于现实生活中。在现实世界中&#xff0c;升职加薪通常需要通过实际的工作表现、专业技能的提…

数据库练习(一)

完成以下SQL语句的编写&#xff1a; student表: score 表&#xff1a; 查询student表的所有记录 Select * from student; 查询student表的第2条到4条记录 select * from student LIMIT 1,3; 从student表查询所有学生的学号&#xff08;id&#xff09;、姓名&#xff08;n…

Java虚拟机——内存的分配详解

内存区域划分 对于大多数的程序员来说&#xff0c;Java 内存比较流行的说法便是堆和栈&#xff0c;这其实是非常粗略的一种划分&#xff0c;这种划分的“堆”对应内存模型的 Java 堆&#xff0c;“栈”是指虚拟机栈&#xff0c;然而 Java 内存模型远比这更复杂&#xff0c;想深…

react结合Redux实现全局状态管理

React与Redux结合使用&#xff0c;可以为React应用提供集中式的状态管理和复杂的业务逻辑处理能力。以下是React中使用Redux的基本步骤和关键概念&#xff1a; 安装所需库 确保已经安装了React和ReactDOM。然后安装Redux及其配套库&#xff1a; npm install redux react-redu…

基于云端部署,支持超大规模会议的召开,同时实现就近接入的功能

随着信息技术的飞速发展&#xff0c;云视频产品已成为企业沟通协作的重要工具。中国联通作为通信行业的领军企业&#xff0c;其云视频产品凭借多项技术优势&#xff0c;在市场中脱颖而出&#xff0c;成为众多企业的首选。 中国联通的云视频产品采用了先进的互联网高清技术&…

【计算机毕业设计】游戏售卖网站——后附源码

&#x1f389;**欢迎来到琛哥的技术世界&#xff01;**&#x1f389; &#x1f4d8; 博主小档案&#xff1a; 琛哥&#xff0c;一名来自世界500强的资深程序猿&#xff0c;毕业于国内知名985高校。 &#x1f527; 技术专长&#xff1a; 琛哥在深度学习任务中展现出卓越的能力&a…

数据结构和算法(哈希表和图(A*算法精讲))

一 、哈希表 1.1 哈希表原理精讲 哈希表-散列表&#xff0c;它是基于快速存取的角度设计的&#xff0c;也是一种典型的“空间换时间”的做法 键(key)&#xff1a; 组员的编号如&#xff0c;1、5、19。。。 值(value)&#xff1a; 组员的其它信息&#xff08;包含性别、年龄和…