Closed jimmydrinkscoffee closed 1 month ago
I just have solved similar problem, maybe you have the same. Check srs container logs with:
docker container logs <container-id>
There was red error lines like "connection refused" and there was ip 172.x.x.x. I made a conclusion that srs server in docker on windows has another ip sub net and it is trying send callback request to localhost backend server (127.0.0.1). So it can not to connect.
I solved it with hosting backend on local network ip (for example 192.168.1.5) and srs server on VM with Ubuntu (with ip in same subnet 192.168.1.6) . I'm not an expert so maybe there is more simple decision
@caesar-ibrahimovic Very appreciate your response. However, you can see network_mode: host
in my srs Docker compose config, which mean srs now is in the same net of my localhost server.
You should know what localhost
means, it's the container itself, not your callback server.
I know what localhost
is, fortunately and my problem is that even though my callback server isn't there (localhost:3000
), I can still stream to the RTMP container. IIRC, it should fail unless the callback API responses with statusCode 2xx. In other words, my RTMP container didn't apply the config at path /usr/local/srs/conf/srs.conf
as written in document.
Version: ossrs/srs:5 Docker image
I run SRS locally via docker-compose for testing but the my
http_hooks
seems not to work.http_hooks
callbacks to my local server listening port3000
. However, there were no requests my server when I started to stream from OBS. And I was still able to do this even when I shutdowned my server.srs.conf
compose.yaml
I placed the
srs.conf
file in the same directory ofcompose.yaml
and it's definitely mounted to the container.