Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsLocal()

bool System.Net.WebProxy.IsLocal ( Uri host)
inlineprivate

Definition at line 260 of file WebProxy.cs.

261 {
262 if (host.IsLoopback)
263 {
264 return true;
265 }
266 string host2 = host.Host;
267 if (IPAddress.TryParse(host2, out IPAddress address))
268 {
270 IPAddress[] array = s_localAddresses ?? (s_localAddresses = Dns.GetHostEntry(Dns.GetHostName()).AddressList);
271 return Array.IndexOf(array, address) != -1;
272 }
273 int num = host2.IndexOf('.');
274 if (num == -1)
275 {
276 return true;
277 }
279 string text = s_domainName ?? (s_domainName = "." + IPGlobalProperties.GetIPGlobalProperties().DomainName);
280 if (text.Length == host2.Length - num)
281 {
282 return string.Compare(text, 0, host2, num, text.Length, StringComparison.OrdinalIgnoreCase) == 0;
283 }
284 return false;
285 }
static volatile string s_domainName
Definition WebProxy.cs:18
static void EnsureNetworkChangeRegistration()
Definition WebProxy.cs:287
static volatile IPAddress[] s_localAddresses
Definition WebProxy.cs:20

References System.array, System.Runtime.Serialization.Dictionary, System.Net.WebProxy.EnsureNetworkChangeRegistration(), System.Net.Dns.GetHostEntry(), System.Net.Dns.GetHostName(), System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties(), System.Array.IndexOf(), System.Net.WebProxy.s_domainName, System.Net.WebProxy.s_localAddresses, System.text, and System.Net.IPAddress.TryParse().

Referenced by System.Net.WebProxy.IsBypassed().