Description
my srs.conf
`
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_server {
enabled on;
listen 8090;
dir ./objs/nginx/html;
https {
enabled on;
listen 8088;
key /www/server/panel/vhost/cert/webrtc.dev.mydomain.com/privkey.pem;
cert /www/server/panel/vhost/cert/webrtc.dev.mydomain.com/fullchain.pem;
}
}
http_api {
enabled on;
listen 1985;
https {
enabled on;
listen 1990;
key /www/server/panel/vhost/cert/webrtc.dev.mydomain.com/privkey.pem;
cert /www/server/panel/vhost/cert/webrtc.dev.mydomain.com/fullchain.pem;
}
}
stats {
network 0;
}
rtc_server {
enabled on;
listen 8000; # UDP port
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
candidate myip;
}
vhost defaultVhost {
rtc {
enabled on;
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
rtmp_to_rtc on;
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
rtc_to_rtmp off;
}
http_hooks {
enabled on;
on_publish http://hunlian.mydomain.com/api/onPublish;
on_unpublish http://hunlian.mydomain.com/api/onUnpublish;
on_play http://hunlian.mydomain.com/api/onPlay;
on_stop http://hunlian.mydomain.com/api/onStop;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}
`
Nginx domain name reverse proxy configuration file.
location ~ ^/(console|players)/ { proxy_pass http://127.0.0.1:8090/$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:8090$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; }
Stream push address: rtmp://myip/live/123456
After starting, the stream push works normally, and it can be played using http://myip:8090/live/123456.m3u8. However, WebRTC does not work.
WebRTC stream pulling method:
In https://webrtc.dev.mydomain.com/players/rtc_player.html, there is an RTC player. The playback address is webrtc://webrtc.dev.mydomain.com/live/123456, which results in a 404 error when accessed.
Browser request headers:
Request URL
https://webrtc.dev.mydomain.com/rtc/v1/play/
Request Method
POST
Status Code
404 Not Found
Remote Address
myip:443
Referrer Policy
strict-origin-when-cross-origin
How should I configure this? I have gone through the tutorial but did not find a solution to my problem.
TRANS_BY_GPT4