Skip to content

Commit

Permalink
Proxy should be loaded at first position
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed Nov 10, 2024
1 parent 699ef0f commit 6d391f0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/SuperSocket.Client/EasyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,14 @@ protected virtual IConnector GetConnector()
{
var connectors = new List<IConnector>();

connectors.Add(new SocketConnector(LocalEndPoint));
if (Proxy is IConnector proxy)
{
connectors.Add(proxy);
}
else
{
connectors.Add(new SocketConnector(LocalEndPoint));
}

var security = Security;

Expand All @@ -122,11 +129,6 @@ protected virtual IConnector GetConnector()
connectors.Add(new SslStreamConnector(security));
}

if (Proxy is IConnector proxy)
{
connectors.Add(proxy);
}

if (CompressionLevel != CompressionLevel.NoCompression)
{
connectors.Add(new GZipConnector(CompressionLevel));
Expand Down

0 comments on commit 6d391f0

Please sign in to comment.