| ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > Instance Class : SetWebRTCAdresses Method |
Type: System.String
The "internal" IPv4 address in format "ip:port" for WebRTC.
Type: System.String
The IPv6 address for WebRTC. It is optional parameter. Avaliable formats are "ip" or "[ip]:port". If address hasn't port, then port generates according to ipv4 port.
Type: System.String
The "external" IPv4 address in format "ip:port" for NAT. It is optional parameter.
Type: ZennoLab.InterfacesLibrary.Enums.Browser.WebRTCMode
WebRTC working mode.
public void SetWebRTCAdresses( string ipv4Address, string ipv6Address, string ipv4Nat, WebRTCMode mode )
Type: System.String
The "internal" IPv4 address in format "ip:port" for WebRTC.
Type: System.String
The IPv6 address for WebRTC. It is optional parameter. Avaliable formats are "ip" or "[ip]:port". If address hasn't port, then port generates according to ipv4 port.
Type: System.String
The "external" IPv4 address in format "ip:port" for NAT. It is optional parameter.
Type: ZennoLab.InterfacesLibrary.Enums.Browser.WebRTCMode
WebRTC working mode.
string ipv4, ipv6, ipNat; // disable WebRTC instance.WebRTCWorkMode = ZennoLab.InterfacesLibrary.Enums.Browser.WebRTCMode.Disable; // then WebRTC is disabled, the output variables will be empty instance.GetWebRTCAdresses(out ipv4, out ipv6, out ipNat); if (!string.IsNullOrWhiteSpace(ipv4) || !string.IsNullOrWhiteSpace(ipv6) || !string.IsNullOrWhiteSpace(ipNat)) throw new Exception("Adresses should be empty then webRTC disabled!!!"); // enable WebRTC instance.WebRTCWorkMode = ZennoLab.InterfacesLibrary.Enums.Browser.WebRTCMode.Enable; // then WebRTC is enabled, the output variables will be "default" instance.GetWebRTCAdresses(out ipv4, out ipv6, out ipNat); if (!ipv4.Equals("default") || !ipv6.Equals("default") || !ipNat.Equals("default")) throw new Exception("Adresses should be 'default' then webRTC enabled!!!"); // emulate WebRTC instance.WebRTCWorkMode = ZennoLab.InterfacesLibrary.Enums.Browser.WebRTCMode.Emulate; // now the output variables will be empty, because we didn't set any values instance.GetWebRTCAdresses(out ipv4, out ipv6, out ipNat); if (!string.IsNullOrWhiteSpace(ipv4) || !string.IsNullOrWhiteSpace(ipv6) || !string.IsNullOrWhiteSpace(ipNat)) throw new Exception("Adresses should be empty then webRTC emulate, but not configured!!!"); // format for IPv4 is "ip:port" // for IPv6 are "ip" or "[ip]:port" var ipv4Emulate = "192.168.5.5:5687"; var ipv6Emulate = "[2001:0:53aa:62c:24cb:218c:9257:63c]:33282"; var ipNatEmulate = "54.234.21.12:7654"; // you can emulate only local ipv4 instance.SetWebRTCAdresses(ipv4Emulate); // now the output variable ipv4 will be "192.168.5.5:5687", other variables will be empty instance.GetWebRTCAdresses(out ipv4, out ipv6, out ipNat); if (ipv4 != ipv4Emulate || !string.IsNullOrWhiteSpace(ipv6) || !string.IsNullOrWhiteSpace(ipNat)) throw new Exception("Wrong set adresses, set only ipv4!!!"); // or you can emulate only local ipv4 and ipv6 instance.SetWebRTCAdresses(ipv4Emulate, ipv6Emulate); // now the output variable ipv4 will be "192.168.5.5:5687", ipv6 will be "[2001:0:53aa:62c:24cb:218c:9257:63c]:33282", but ipNat will be empty instance.GetWebRTCAdresses(out ipv4, out ipv6, out ipNat); if (ipv4 != ipv4Emulate || ipv6 != ipv6Emulate || !string.IsNullOrWhiteSpace(ipNat)) throw new Exception("Wrong set adresses, set ipv4 and ipv6!!!"); // or you can emulate all addresses instance.SetWebRTCAdresses(ipv4Emulate, ipv6Emulate, ipNatEmulate); // now the output variable ipv4 will be "192.168.5.5:5687", ipv6 will be "[2001:0:53aa:62c:24cb:218c:9257:63c]:33282", ipNat will be "54.234.21.12:7654" instance.GetWebRTCAdresses(out ipv4, out ipv6, out ipNat); if (ipv4 != ipv4Emulate || ipv6 != ipv6Emulate || ipNat != ipNatEmulate) throw new Exception("Wrong set adresses, set ipv4, ipv6, ipNat!!!");
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.