Glimesh / broadcast-box

A broadcast, in a box.
MIT License
1.44k stars 78 forks source link

Selfhosted - Lack of Clear Documentation #41

Closed LumiWasTaken closed 10 months ago

LumiWasTaken commented 1 year ago

Hiya,

i have been trying to set up my own instance for the past ~2h and keep failing left and right.

My first attempt was behind a reverse proxy, but when i realized it exposes UDP ports i moved it to using my SSL Certs directly and running in host mode.

The website is reachable via subdomain.domain.com:8080

And this is where the issues start. SetRemoteDescription called with no ice-ufrag

Keeps popping up which is weird.

So i saw this existing issue: https://github.com/Glimesh/broadcast-box/issues/40 And tried setting all kinds of parameters.

i use UFW as a firewall so as suggested i opened up 8080 for UDP and did set UDP_MUX_PORT I also did use INCLUDE_PUBLIC_IP_IN_NAT_1_TO_1_IP but nothing works.

What is the root cause of this issue and whats a fool proof guide to set this up. or which ports do need to be opened. Troubleshooting this has proved impossible for me.

Sean-Der commented 1 year ago

Hi @LumiWasTaken

SetRemoteDescription called with no ice-ufrag is an issue with the client. It is attempting to start a session without sending an audio or video. What client are you using?

LumiWasTaken commented 1 year ago

Hi @LumiWasTaken

SetRemoteDescription called with no ice-ufrag is an issue with the client. It is attempting to start a session without sending an audio or video. What client are you using?

My setup is: a VPS with a Public IP as Server where i have the box running (Docker Container)

A Streamer which is OBS with WHIP Support on a Arch based Linux system

A Client which could be my Own PC or a Phone. (Planning to share this with a few of my friends to have a private stream since Discord screen sharing on Linux runs bad without sound.

Thank you for your time, maybe this could lead to some kind of FAQ inside the wiki.

kilotone commented 1 year ago

I receive this error too, is there any list of exhaustive ports aside from the general udp_mux and rest http server (80) that might be needed? I'm doing a bit more of a complicated setup with an aws network load balancer. Is 443 expected, and/or what about tcp and websockets?

NachoPicchu commented 11 months ago

Very same Situation here. Using OBS 30.0.0 with WHIP on Arch Linux. The only output I'm getting from the go server is SetRemoteDescription called with no ice-ufrag. However, that message doesn't seem to be related to the actual error. When I set OBS to broadcast to "http://localhost:8080/api/whip", OBS seems to be happy and indicates sane-looking bandwidth usage, but attempting to view any streamed footage via the frontend doesn't work. When I set the broadcast destination to https://b.siobud.com/api/whip, everything works fine.

In both instances, OBS's console output mirrors the message SetRemoteDescription called with no ice-ufrag, after the stream has ended. So I think the error message does not indicate the nature of the experienced issue.

LumiWasTaken commented 11 months ago

@NachoPicchu Try to use a different browser, it sounds silly but some browsers block the RPC protocol to hide the IP Adress (as it could be a potential leak)

NachoPicchu commented 11 months ago

@LumiWasTaken It doesn't work on firefox or google chrome. It still works when changing the broadcast address to https://b.siobud.com/api/whip, though.

LumiWasTaken commented 11 months ago

@NachoPicchu

Can you try https://stream.lumify.cat ?

make sure to open port 8080 with this setup

I use this docker-compose.yml:

version: '3'

services:
  broadcast-box:
    build:
      context: ./broadcast-box-repo
    environment:
      - INCLUDE_PUBLIC_IP_IN_NAT_1_TO_1_IP=yes
      - UDP_MUX_PORT=8080
    container_name: broadcast-box
    hostname: broadcast-box
    network_mode: "host"
    privileged: true
    volumes:
      - /etc/letsencrypt:/etc/letsencrypt
NachoPicchu commented 11 months ago

@LumiWasTaken Thanks for the compose file. Your instance is working for me, using your compose file minus the certificate volume does not. Have you set any variables in the .env file? I'm testing everything locally by the way. Server and browser are on the same machine.

LumiWasTaken commented 11 months ago

@NachoPicchu

.env.production                                                  HTTP_ADDRESS=":8080"
ENABLE_HTTP_REDIRECT=
REACT_APP_API_PATH="/api"

# /etc/letsencrypt/live/<your-domain-name>/privkey.pem
SSL_KEY=/etc/letsencrypt/live/stream.lumify.cat/privkey.pem

# /etc/letsencrypt/live/<your-domain-name>/fullchain.pem
SSL_CERT=/etc/letsencrypt/live/stream.lumify.cat/fullchain.pem

If you run it locally you might want to disable "INCLUDE_PUBLIC_IP" etc.

NachoPicchu commented 11 months ago

@LumiWasTaken Thanks a lot for your help! It seems that the issue, at least for me, is something network related. I went ahead and deployed your compose file minus the cert volume, but this time on my (remote) server, and it works.

chihirooooooooo commented 11 months ago

I am having the same issue. I can't host stream locally. Is there any solution?

Sean-Der commented 10 months ago

Hi everyone. I have made a few changes/additions that I hope will help.

Network Test on Startup

Broadcast Box will now make sure that connectivity is possible on startup. If your server is configured incorrectly it will tell you. You can read more about it here this will hopefully help people debugging more.

Docker Compose with HTTPs

I have updated the docker-compose to use Caddy. All you need to do is set URL and everything will just work! https://github.com/Glimesh/broadcast-box?tab=readme-ov-file#docker-compose


@chihirooooooooo and @kilotone if you are still having trouble would love to help! I am available on discord or on GitHub. thanks!