API Reference
Class
PublicNetworkTargetValidator
Resolves outbound host names and rejects private, local, documentation, multicast, and otherwise special-use addresses.
Inheritance
- Object
- PublicNetworkTargetValidator
Constructors
PublicNetworkTargetValidator 2 overloads
public PublicNetworkTargetValidator() #Creates a validator using the operating system DNS resolver.
public PublicNetworkTargetValidator(Func<String, CancellationToken, Task<IPAddress[]>> resolver) #Creates a validator with an explicit resolver.
Parameters
- resolver System.Func{System.String,System.Threading.CancellationToken,System.Threading.Tasks.Task{System.Net.IPAddress[]}}
Methods
public static Boolean IsPublicAddress(IPAddress address) #Returns:
BooleanReturns true only for addresses that are not in known non-public or special-use ranges.
Parameters
- address System.Net.IPAddress
public async Task<PublicNetworkTargetValidationResult> ValidateAsync(String host, CancellationToken cancellationToken = null) #Returns:
Task<PublicNetworkTargetValidationResult>Resolves and validates a host before an outbound connection is attempted.
Parameters
- host System.String
- cancellationToken System.Threading.CancellationToken = null
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object