- conf/haproxy: 18443 TLS终结+SNI选证+首字节嗅探,RTMPS→1935,HTTP→8445 - conf/nginx: 8445 明文口承载 tsk 双域名 /live/ 与 /danmaku - conf/certs: pem 构建脚本(接入 acme.sh 续期钩子) - run.sh: 修正为当前部署相对路径 - srs.conf: http_hooks 恢复并指向 api.rrrosmontis.icu (bj live_monitor) - DEPLOYMENT.md: 完整部署记忆(架构/证书/通知链路/重建步骤/已知坑)
59 lines
2.1 KiB
Plaintext
Executable File
59 lines
2.1 KiB
Plaintext
Executable File
# conf/srs.conf
|
|
# SRS 全局配置
|
|
listen 1935; # RTMP 推流端口
|
|
max_connections 1000; # 最大连接数
|
|
daemon off; # Windows 下建议关闭守护进程模式,便于调试
|
|
srs_log_tank console; # 日志输出到控制台(可改为 file 并指定路径)
|
|
|
|
# HTTP API 配置(供 Nginx 反向代理使用)
|
|
http_api {
|
|
enabled on;
|
|
listen 1985; # SRS HTTP API 端口,Nginx 代理到该端口
|
|
#crossdomain on; # 允许跨域请求
|
|
}
|
|
|
|
# HTTP 文件服务(可选,本场景不需要)
|
|
http_server {
|
|
enabled on;
|
|
listen 8080;
|
|
dir ./objs/nginx/html;
|
|
}
|
|
|
|
# WebRTC 服务器配置(关键)
|
|
rtc_server {
|
|
enabled on;
|
|
listen 8000; # WebRTC 媒体 UDP 端口
|
|
# 重要:必须设置为你的公网 IP,否则客户端无法连接
|
|
candidate 39.97.55.150;
|
|
}
|
|
|
|
# 默认虚拟主机配置
|
|
vhost __defaultVhost__ {
|
|
# 启用 WebRTC 支持
|
|
rtc {
|
|
enabled on;
|
|
rtmp_to_rtc on;
|
|
pli_for_rtmp on;
|
|
}
|
|
|
|
http_remux {
|
|
enabled on;
|
|
mount [vhost]/[app]/[stream].flv;
|
|
}
|
|
|
|
hls {
|
|
enabled on; # 开启 HLS
|
|
hls_path ./objs/nginx/html; # HLS 文件存储路径(需与 http_server 的目录一致)
|
|
hls_fragment 2; # 每个 TS 切片时长(秒)
|
|
hls_window 5; # 滚动窗口大小(秒)
|
|
hls_cleanup on; # 自动清理过期切片
|
|
}
|
|
|
|
# http_hooks 指向 bj 的 live_monitor(副站回调),经 api.rrrosmontis.icu 公网入口
|
|
# 2026-09-01 恢复:SRS 6.0 支持 https hooks;流名需为 room_<房间号> 才触发 QQ 通知
|
|
http_hooks {
|
|
enabled on;
|
|
on_publish https://api.rrrosmontis.icu/v1/live/publish/local/on_publish;
|
|
on_unpublish https://api.rrrosmontis.icu/v1/live/publish/local/on_unpublish;
|
|
}
|
|
} |