Domain name AND Server behind NAT - fix for javascript files

Issues when playing with WebRTC Player

Domain name AND Server behind NAT - fix for javascript files

Postby admin » Mon Aug 27, 2018 3:11 pm

As described in

When you are specifying domain name instead of IP address (domain name must be used for signaling over secure websocket) of the server as a parameter to javascript player/publisher function in your web page,
AND your server is behind NAT, then you need to make a change in
unrealwebrtcplayer.js for playing and in unrealwebrtcpublisher.js for publishing.

What you need to do:
In unrealwebrtcplayer.js or unrealwebrtcpublisher.js, find function EnsureValidCandidate
1. Modify first line of that function: remove the last condition from the if: "|| !ValidateIPaddress(ipAddress)", so the modified line is:
if (( !== -1) || !useSingleWebRTCPort || (ipAddress == "")) {
2. Modify third line from the bottom of that function: instead of
candLines[ipIndex] = ipAddress;
hardcode your server public IP, for example, "":
candLines[ipIndex] = "";
Site Admin
Posts: 1042
Joined: Fri Aug 21, 2009 10:13 am

Return to Playing with WebRTC Player

Who is online

Users browsing this forum: No registered users and 1 guest