1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-15 02:13:01 +00:00

add Schema check

This commit is contained in:
Mohammad Reza
2022-04-13 13:18:38 +04:30
parent 4db43517b7
commit 4f4d2ccff3
2 changed files with 28 additions and 5 deletions
@@ -212,12 +212,18 @@ namespace CryptoExchange.Net.Sockets
/// <inheritdoc />
public virtual void SetProxy(ApiProxy proxy)
{
_socket.Options.Proxy = new WebProxy
if (!proxy.IsSchemaProvided())
{
Address = new Uri($"{proxy.Host}:{proxy.Port}"),
Credentials = proxy.Password == null ? null : new NetworkCredential(proxy.Login, proxy.Password)
};
_socket.Options.Proxy = new WebProxy(proxy.Host, proxy.Port);
}
else
{
_socket.Options.Proxy = new WebProxy
{
Address = new Uri($"{proxy.Host}:{proxy.Port}"),
Credentials = proxy.Password == null ? null : new NetworkCredential(proxy.Login, proxy.Password)
};
}
}
/// <inheritdoc />