diff --git a/src/SuperSocket.Client/EasyClient.cs b/src/SuperSocket.Client/EasyClient.cs index c1ec3c488..b6e8292cf 100644 --- a/src/SuperSocket.Client/EasyClient.cs +++ b/src/SuperSocket.Client/EasyClient.cs @@ -112,7 +112,14 @@ protected virtual IConnector GetConnector() { var connectors = new List(); - connectors.Add(new SocketConnector(LocalEndPoint)); + if (Proxy is IConnector proxy) + { + connectors.Add(proxy); + } + else + { + connectors.Add(new SocketConnector(LocalEndPoint)); + } var security = Security; @@ -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));