Support NAT media binding and cross-host reverse proxies#394
Draft
imanYazizi wants to merge 1 commit into
Draft
Conversation
Bind media services to the host's detected internal IPv4 while continuing to announce the public address. Add an opt-in nginx bind for cross-host reverse proxies, preserve forwarded HTTPS scheme, and document the deployment flow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.env, firewall, and regeneration workflowProblem
EXTERNAL_IPv4is currently used as both the announced and listening address for WebRTC SFU and coturn. On a host behind 1:1 or port-forwarding NAT, the public address is not assigned to a local interface. The web application remains reachable, but media services cannot bind or produce usable ICE candidates, so microphone and camera connections stall or fail.A reverse proxy on another machine has a related deployment gap: nginx port
48087is published only on loopback and the Docker bridge. Manually publishing it solves reachability, but the inner nginx configuration then replacesX-Forwarded-Proto: httpswith its local HTTP scheme when proxying Greenlight.Related reports: #104, #117, and #270.
How this fixes deployment
scripts/setupnow detects the source address of the host's default IPv4 route and stores it asINTERNAL_IPv4. The generated Compose configuration uses:INTERNAL_IPv4as the WebRTC SFU listening addressEXTERNAL_IPv4as the SFU announced addresspublic/privateexternal-address mapping with relay traffic bound toINTERNAL_IPv4For existing
.envfiles, Compose generation falls back toEXTERNAL_IPv4, preserving the current behavior on directly connected hosts.NGINX_BIND_IPis optional and empty by default. Operators with a reverse proxy on another host can bind only48087to a reachable host address and restrict that port to the proxy at the firewall. Nginx honors an incoming HTTPS forwarded scheme while retaining$schemeas the fallback.IPv6 behavior is unchanged.
Validation
git diff --checkbash -n scripts/setup scripts/generate-compose