Class
ReverseProxy

This class is used to create a reverse proxy that listens on a specified port and forwards requests to a remote host. It can handle both HTTP and HTTPS requests, and can preserve the original host header if needed.

Definition

Constructors

ReverseProxy(ReverseProxySettings)

Initializes a new instance of the ReverseProxy class.

Declaration

cs-api-definition
public ReverseProxy(ReverseProxySettings settings)

Parameters

settings

ReverseProxySettings

The settings for the reverse proxy.

Exceptions

ArgumentNullException

Thrown when settings are null.

ArgumentOutOfRangeException

Thrown when the client port is out of range.

Methods

Start()

Starts the reverse proxy and begins listening for incoming requests.

Declaration

cs-api-definition
public bool Start()

Returns

bool

True if the proxy started successfully; otherwise, false.

Stop()

Stops the reverse proxy and releases any resources used by it.

Declaration

cs-api-definition
public void Stop()