Proxy.Client by Daniel Buckle

<PackageReference Include="Proxy.Client" Version="1.1.6" />

 SocketExtensions

static class SocketExtensions
Extension class that performs socket operations.
public static ValueTask ConnectAsync(this Socket socket, string host, int port, int connectTimeout, CancellationTokenSourceManager cancellationTokenSourceManager)

Asynchronously Connects to the Destination Server given a connect timeout.

public static ValueTask<int> ReadAsync(this SslStream sslStream, Memory<byte> buffer, int readTimeout, CancellationTokenSourceManager cancellationTokenSourceManager)

Asynchronously reads data from the Destination Server through an SSL connection given a read timeout.

public static ValueTuple<string, float> ReceiveAll(this Socket socket)

Receives the response from the destination server.

public static ValueTuple<string, float> ReceiveAll(this SslStream sslStream)

Receives the response from the destination server.

public static Task<ValueTuple<string, float>> ReceiveAllAsync(this Socket socket, int readTimeout, CancellationTokenSourceManager cancellationTokenSourceManager)

Asynchronously receives the response from the destination server.

public static Task<ValueTuple<string, float>> ReceiveAllAsync(this SslStream sslStream, int readTimeout, CancellationTokenSourceManager cancellationTokenSourceManager)

Asynchronously receives the response from the destination server.

public static ValueTask<int> ReceiveAsync(this Socket socket, Memory<byte> buffer, int readTimeout, CancellationTokenSourceManager cancellationTokenSourceManager)

Asynchronously reads data from the Destination Server given a read timeout.

public static ValueTask<int> SendAsync(this Socket socket, ReadOnlyMemory<byte> buffer, int writeTimeout, CancellationTokenSourceManager cancellationTokenSourceManager)

Asynchronously sends data to the Destination Server given a write timeout.

public static ValueTask WriteAsync(this SslStream sslStream, ReadOnlyMemory<byte> buffer, int writeTimeout, CancellationTokenSourceManager cancellationTokenSourceManager)

Asynchronously sends data to the Destination Server through an SSL connection given a write timeout.