janus部署

2024-04-23 01:44
文章标签 部署 janus

本文主要是介绍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 hnb: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

运⾏ Janus

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

在这里插入图片描述

错误问题解决

[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

这篇关于janus部署的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/927452

相关文章

Spring Boot项目部署命令java -jar的各种参数及作用详解

《SpringBoot项目部署命令java-jar的各种参数及作用详解》:本文主要介绍SpringBoot项目部署命令java-jar的各种参数及作用的相关资料,包括设置内存大小、垃圾回收... 目录前言一、基础命令结构二、常见的 Java 命令参数1. 设置内存大小2. 配置垃圾回收器3. 配置线程栈大小

tomcat多实例部署的项目实践

《tomcat多实例部署的项目实践》Tomcat多实例是指在一台设备上运行多个Tomcat服务,这些Tomcat相互独立,本文主要介绍了tomcat多实例部署的项目实践,具有一定的参考价值,感兴趣的可... 目录1.创建项目目录,测试文China编程件2js.创建实例的安装目录3.准备实例的配置文件4.编辑实例的

SpringBoot配置Ollama实现本地部署DeepSeek

《SpringBoot配置Ollama实现本地部署DeepSeek》本文主要介绍了在本地环境中使用Ollama配置DeepSeek模型,并在IntelliJIDEA中创建一个Sprin... 目录前言详细步骤一、本地配置DeepSeek二、SpringBoot项目调用本地DeepSeek前言随着人工智能技

通过Docker Compose部署MySQL的详细教程

《通过DockerCompose部署MySQL的详细教程》DockerCompose作为Docker官方的容器编排工具,为MySQL数据库部署带来了显著优势,下面小编就来为大家详细介绍一... 目录一、docker Compose 部署 mysql 的优势二、环境准备与基础配置2.1 项目目录结构2.2 基

CentOS 7部署主域名服务器 DNS的方法

《CentOS7部署主域名服务器DNS的方法》文章详细介绍了在CentOS7上部署主域名服务器DNS的步骤,包括安装BIND服务、配置DNS服务、添加域名区域、创建区域文件、配置反向解析、检查配置... 目录1. 安装 BIND 服务和工具2.  配置 BIND 服务3 . 添加你的域名区域配置4.创建区域

OpenManus本地部署实战亲测有效完全免费(最新推荐)

《OpenManus本地部署实战亲测有效完全免费(最新推荐)》文章介绍了如何在本地部署OpenManus大语言模型,包括环境搭建、LLM编程接口配置和测试步骤,本文给大家讲解的非常详细,感兴趣的朋友一... 目录1.概况2.环境搭建2.1安装miniconda或者anaconda2.2 LLM编程接口配置2

大数据spark3.5安装部署之local模式详解

《大数据spark3.5安装部署之local模式详解》本文介绍了如何在本地模式下安装和配置Spark,并展示了如何使用SparkShell进行基本的数据处理操作,同时,还介绍了如何通过Spark-su... 目录下载上传解压配置jdk解压配置环境变量启动查看交互操作命令行提交应用spark,一个数据处理框架

如何使用Docker部署FTP和Nginx并通过HTTP访问FTP里的文件

《如何使用Docker部署FTP和Nginx并通过HTTP访问FTP里的文件》本文介绍了如何使用Docker部署FTP服务器和Nginx,并通过HTTP访问FTP中的文件,通过将FTP数据目录挂载到N... 目录docker部署FTP和Nginx并通过HTTP访问FTP里的文件1. 部署 FTP 服务器 (

C#集成DeepSeek模型实现AI私有化的流程步骤(本地部署与API调用教程)

《C#集成DeepSeek模型实现AI私有化的流程步骤(本地部署与API调用教程)》本文主要介绍了C#集成DeepSeek模型实现AI私有化的方法,包括搭建基础环境,如安装Ollama和下载DeepS... 目录前言搭建基础环境1、安装 Ollama2、下载 DeepSeek R1 模型客户端 ChatBo

Ubuntu 22.04 服务器安装部署(nginx+postgresql)

《Ubuntu22.04服务器安装部署(nginx+postgresql)》Ubuntu22.04LTS是迄今为止最好的Ubuntu版本之一,很多linux的应用服务器都是选择的这个版本... 目录是什么让 Ubuntu 22.04 LTS 变得安全?更新了安全包linux 内核改进一、部署环境二、安装系统