Class Extensions
- Namespace
- LNURL
- Assembly
- LNURL.Core.dll
Provides extension methods for Uri used by the LNURL library to determine network characteristics of service endpoints.
public static class Extensions
- Inheritance
-
Extensions
- Inherited Members
Methods
IsLocalNetwork(Uri)
Determines whether the URI points to a local network address.
This includes DNS names ending in .internal, .local, .lan,
single-label hostnames (no dots), and RFC 1918 / loopback IP addresses.
LNURL allows HTTP (instead of HTTPS) for local network addresses.
public static bool IsLocalNetwork(this Uri server)
Parameters
serverUriThe URI to check.
Returns
- bool
trueif the URI host is on a local network; otherwisefalse.
Exceptions
- ArgumentNullException
Thrown when
serverisnull.
IsOnion(Uri)
Determines whether the URI points to a Tor hidden service (.onion address). LNURL allows HTTP (instead of HTTPS) for .onion addresses.
public static bool IsOnion(this Uri uri)
Parameters
uriUriThe URI to check.
Returns
- bool
trueif the URI host ends with.onion; otherwisefalse.