diff --git a/src/SuperSocket.Client/EasyClient.cs b/src/SuperSocket.Client/EasyClient.cs index 1910a0a63..c1ec3c488 100644 --- a/src/SuperSocket.Client/EasyClient.cs +++ b/src/SuperSocket.Client/EasyClient.cs @@ -57,6 +57,8 @@ public class EasyClient : IEasyClient protected IConnection Connection { get; private set; } + public IConnector Proxy { get; set; } + protected ILogger Logger { get; set; } protected ConnectionOptions Options { get; private set; } @@ -120,6 +122,11 @@ 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)); diff --git a/src/SuperSocket.Client/IEasyClient.cs b/src/SuperSocket.Client/IEasyClient.cs index df101601b..f0336ffc3 100644 --- a/src/SuperSocket.Client/IEasyClient.cs +++ b/src/SuperSocket.Client/IEasyClient.cs @@ -16,6 +16,8 @@ public interface IEasyClient : IEasyClient where TReceivePackage : class { + IConnector Proxy { get; set; } + ValueTask ConnectAsync(EndPoint remoteEndPoint, CancellationToken cancellationToken = default); ValueTask ReceiveAsync();