OBS cannot connect to server rtmp port when port is forwarded on router

I am trying to set up live streaming on my instance, but I have issues with the rtmp port. My server is hosted made accessible via a reverse proxy running on another machine, but still on the same network. Due to my reverse proxy software (caddy) not being able to handle rtmp traffic (as far as I know), I have just set up a port forward from the machine running the peertube instance (on docker) to the router.

When trying to stream using the above configuration, OBS tries to connect to the server and doesn’t fail immediately; instead, it takes a few seconds for it to stop (which I think means that there is a route to the server). As opposed to that, when the port forward on the router is wrong, when the port on the rtmp url is different, when trying to use directly an ip like « localhost » or the local ip of the machine, OBS fails immediately.

I’ve never done livestreaming with Peertube, but I saw a video about it yesterday.
Have you try using rtmps like explained here? https://video.fedihost.co/w/dAoCCAVrJ1t7xQw7U9GUbu?start=6m27s

So, I did some more investigating (nmap is a great tool) and I got streaming to work, but it is a bit of a bodge: streaming only works if I try to stream directly to the docker container’s ip.

For some reason, (unlike port 9000) port 1935 is only accessible on 172.69.0.42 (predefined docker ip) and not on my 192.168.1.0/24 ip that my machine has on the local network, which means that I can’t forward it to my router.

I can’t find anything in the default docker-compose.yml config that would suggest that one would be exposed to all hosts and one wouldn’t, so if anyone could be of help I’d appreciate it.

Check that this line is in your docker-compose file:

This is what makes the port available on the host.

It was a docker compose issue with it not changing the settings.

I have set docker-compose.yml to allow port 1935 since I have been trying to get streaming to work, but, it turns out that docker compose restart doesn’t change the ports like docker compose down && docker compose up -d do.

I have been using this piece of software to self host several services over the last 1,5 year and this is the first time I notice this.

oh, right! i remember having similar issues once… That’s probably why I always use down and up instead of restart, without remembering why :sweat_smile: