websocket-sharp icon indicating copy to clipboard operation
websocket-sharp copied to clipboard

Local ip check update

Open foxmcloud555 opened this issue 2 years ago • 2 comments

We need to establish a websocket connection between two devices connected to the same mobile hotspot.

This means we can't reliably get a valid DNS entry for the isLocal check.

I have just added extension that will return true if a supplied IP is within the Private ranges.

foxmcloud555 avatar May 25 '23 15:05 foxmcloud555

tested this today and also saved me a lot of trouble, while trying to connect via iOS on a local network (no internet).

var name = System.Net.Dns.GetHostName ();
var addrs = System.Net.Dns.GetHostAddresses (name);

would never return the ip address in the local network, which you can view via Wifi (i) icon. Worked on android though.

kijz avatar Jun 21 '23 10:06 kijz

Thanks for the commit, it really helped me out! You probably do want to update the pull request to use the same styling as the rest of the codebase.

MerijnHendriks avatar Dec 12 '23 12:12 MerijnHendriks