janus在mac上的使用

安装依赖

brew install jansson libnice openssl srtp libusrsctp libmicrohttpd libwebsockets cmake rabbitmq-c sofia-sip opus libogg curl glib pkg-config gengetopt autoconf automake libtool libconfig

下载源码

git clone https://github.com/meetecho/janus-gateway

编译

sh autogen.sh
./configure --prefix=/usr/local/janus PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig

make

make install

make configs

安装nginx

sudo brew install nginx

修改配置文件

vim /usr/local/etc/nginx/nginx.conf

janus在mac上的使用

 server{
   listen 80;
   listen *:443 ssl;
   server_name localhost;
   location / {
    root /usr/local/janus/share/janus/demos;
    index index.html index.htm index.php;
   }
  ssl_certificate /usr/local/janus/share/janus/certs/mycert.pem;
  ssl_certificate_key /usr/local/janus/share/janus/certs/mycert.key;
 }

启动及停止命令

janus在mac上的使用

测试

1、启动nginx

sudo nginx

2、启动janus

cd /usr/local/janus/bin/

./janus

3、访问http://localhost

janus在mac上的使用

https://localhost,同样ok的

janus在mac上的使用

4、demo的echo测试

janus在mac上的使用