srs搭建

编译

git clone -b 4.0release https://gitee.com/ossrs/srs.git

cd srs/trunk

./configure

make

设置IP

env CANDIDATE="222.92.212.125"

启动

./objs/srs -c conf/https.srs.conf

nginx配置

server {

listen 8443 ssl http2;

server_name _;

ssl_certificate /mnt/disk1/wangchao/srs/srs/trunk/conf/server.crt;

ssl_certificate_key /mnt/disk1/wangchao/srs/srs/trunk/conf/server.key;

# For SRS homepage, console and players

# http://r.ossrs.net/console/

# http://r.ossrs.net/players/

location ~ ^/(console|players)/ {

proxy_pass http://127.0.0.1:8080/$request_uri;

}

# For SRS streaming, for example:

# http://r.ossrs.net/live/livestream.flv

# http://r.ossrs.net/live/livestream.m3u8

location ~ ^/.+/.*\.(flv|m3u8|ts|aac|mp3)$ {

proxy_pass http://127.0.0.1:8080$request_uri;

}

# For SRS backend API for console.

# For SRS WebRTC publish/play API.

location ~ ^/(api|rtc)/ {

proxy_pass http://127.0.0.1:1985$request_uri;

}

}

推流测试

https://10.10.13.11:8443/players/rtc_publisher.html?schema=https&port=8443&api=8443

播放测试

https://10.10.13.11:8443/players/rtc_player.html?schema=https&port=8443&api=8443

参考

Build | SRS

HTTP API | SRS

metartc对应的webrtc

https://github.com/metartc/srs-webrtc265

你可能感兴趣的:(srs,webrtc)