diff --git a/README.md b/README.md index 7f37428..7ae90a1 100644 --- a/README.md +++ b/README.md @@ -195,15 +195,18 @@ docker-compose up -d The backend can be configured with the following environment variables. - `DISABLE_STATUS` - Disable the status API -- `ENABLE_HTTP_REDIRECT` - HTTP traffic will be redirect to HTTPS +- `DISABLE_FRONTEND` - Disable the serving of frontend. Only REST APIs + WebRTC is enabled. - `HTTP_ADDRESS` - HTTP Server Address -- `INCLUDE_PUBLIC_IP_IN_NAT_1_TO_1_IP` - Like `NAT_1_TO_1_IP` but autoconfigured -- `INTERFACE_FILTER` - Only use a certain interface for UDP traffic -- `NAT_1_TO_1_IP` - If behind a NAT use this to auto insert your public IP - `NETWORK_TEST_ON_START` - When "true" on startup Broadcast Box will check network connectivity + +- `ENABLE_HTTP_REDIRECT` - HTTP traffic will be redirect to HTTPS - `SSL_CERT` - Path to SSL certificate if using Broadcast Box's HTTP Server - `SSL_KEY` - Path to SSL key if using Broadcast Box's HTTP Server +- `NAT_1_TO_1_IP` - Announce IPs that don't belong to local machine (like Public IP). delineated by ',' +- `INCLUDE_PUBLIC_IP_IN_NAT_1_TO_1_IP` - Like `NAT_1_TO_1_IP` but autoconfigured +- `INTERFACE_FILTER` - Only use a certain interface for UDP traffic +- `NAT_ICE_CANDIDATE_TYPE` - By default setting a NAT_1_TO_1_IP overrides. Set this to `srflx` to instead append IPs - `STUN_SERVERS` - List of STUN servers delineated by '|'. Useful if Broadcast Box is running behind a NAT - `UDP_MUX_PORT_WHEP` - Like `UDP_MUX_PORT` but only for WHEP traffic diff --git a/internal/webrtc/webrtc.go b/internal/webrtc/webrtc.go index 133354f..a6f0e87 100644 --- a/internal/webrtc/webrtc.go +++ b/internal/webrtc/webrtc.go @@ -197,11 +197,16 @@ func createSettingEngine(isWHIP bool, udpMuxCache map[int]*ice.MultiUDPMuxDefaul } if os.Getenv("NAT_1_TO_1_IP") != "" { - NAT1To1IPs = append(NAT1To1IPs, os.Getenv("NAT_1_TO_1_IP")) + NAT1To1IPs = append(NAT1To1IPs, strings.Split(os.Getenv("NAT_1_TO_1_IP"), ",")...) + } + + natICECandidateType := webrtc.ICECandidateTypeHost + if os.Getenv("NAT_ICE_CANDIDATE_TYPE") == "srflx" { + natICECandidateType = webrtc.ICECandidateTypeSrflx } if len(NAT1To1IPs) != 0 { - settingEngine.SetNAT1To1IPs(NAT1To1IPs, webrtc.ICECandidateTypeHost) + settingEngine.SetNAT1To1IPs(NAT1To1IPs, natICECandidateType) } if os.Getenv("INTERFACE_FILTER") != "" {