Add socks support on BTCPay Server to query onion endpoints

This commit is contained in:
nicolas.dorier
2019-03-18 00:03:02 +09:00
parent 7998ea142b
commit 014d08f38a
11 changed files with 369 additions and 21 deletions

View File

@@ -39,6 +39,12 @@ namespace BTCPayServer.Configuration
return (T)(object)str;
else if (typeof(T) == typeof(IPAddress))
return (T)(object)IPAddress.Parse(str);
else if (typeof(T) == typeof(EndPoint))
{
if (EndPointParser.TryParse(str, out var endpoint))
return (T)(object)endpoint;
throw new FormatException("Invalid endpoint");
}
else if (typeof(T) == typeof(IPEndPoint))
{
var separator = str.LastIndexOf(":", StringComparison.InvariantCulture);