Glimesh / broadcast-box

A broadcast, in a box.
MIT License
1.33k stars 69 forks source link

How should I do peer-to-peer connection via broadcast-box #36

Closed littleq0903 closed 9 months ago

littleq0903 commented 1 year ago

In the readme:

"With Broadcast Box you can serve your video without a public IP or forwarding ports! Run Broadcast Box on the same machine that you are running OBS, and share your video with the world! WebRTC comes with P2P technology, so users can broadcast and playback video without paying for dedicated servers.

You could also use P2P to pull other broadcasters into your stream. No special configuration or servers required anymore to get sub-second costreams."

How should I set this up? if I set up a broadcast-box on a machine with a private ip, in another machine not in the same LAN (private ip) how should I point the WHEP location?

Thanks in advance.

littleq0903 commented 1 year ago
webrtc.NewPeerConnection(webrtc.Configuration{
        ICEServers: []webrtc.ICEServer{
            {
                URLs: []string{"stun:stun.l.google.com:19302"},
            },
        },
    })
littleq0903 commented 1 year ago

24

petrmalkov commented 10 months ago
webrtc.NewPeerConnection(webrtc.Configuration{
      ICEServers: []webrtc.ICEServer{
          {
              URLs: []string{"stun:stun.l.google.com:19302"},
          },
      },
  })

Is it a kind of a public server to publish through? How to pass this parameter into docker?

Sean-Der commented 9 months ago

Hi @littleq0903 @petrmalkov

I added support for this! ICE Server for server can be set via env variable

STUN_SERVERS allows users to pass a list of STUN servers. They are seperated by a '|'. Only the URL is required. The following is an example.

export STUN_SERVERS='stun.l.google.com:19302|stun1.l.google.com:19302'