Table of Contents

Class Proxy

Namespace
Fluxzy
Assembly
Fluxzy.Core.dll

A proxy capture instance that can be started and disposed.

public class Proxy : IAsyncDisposable
Inheritance
Proxy
Implements
Inherited Members

Constructors

Proxy(FluxzySetting, ICertificateProvider, CertificateAuthorityManager, ITcpConnectionProvider?, IUserAgentInfoProvider?, FromIndexIdProvider?, IDnsSolver?, CancellationTokenSource?, ProxyAuthenticationMethod?)

Create a new instance with specific providers. If a provider is not provided the default will be used.

public Proxy(FluxzySetting startupSetting, ICertificateProvider certificateProvider, CertificateAuthorityManager certificateAuthorityManager, ITcpConnectionProvider? tcpConnectionProvider = null, IUserAgentInfoProvider? userAgentProvider = null, FromIndexIdProvider? idProvider = null, IDnsSolver? dnsSolver = null, CancellationTokenSource? externalCancellationSource = null, ProxyAuthenticationMethod? proxyAuthenticationMethod = null)

Parameters

startupSetting FluxzySetting

The startup Setting

certificateProvider ICertificateProvider

A certificate provider

certificateAuthorityManager CertificateAuthorityManager

A certificate authority manager

tcpConnectionProvider ITcpConnectionProvider

A tcp connection Provider

userAgentProvider IUserAgentInfoProvider

An user Agent provider

idProvider FromIndexIdProvider

An id provider

dnsSolver IDnsSolver

Add a custom DNS solver

externalCancellationSource CancellationTokenSource

An external cancellation token

proxyAuthenticationMethod ProxyAuthenticationMethod

Use this authentication method instead of the one provided in FluxzySetting

Exceptions

ArgumentNullException

Proxy(FluxzySetting, ITcpConnectionProvider?, ProxyAuthenticationMethod?)

Create a new instance of Proxy with the provided setting. An InMemoryCertificateCache will be used as the certificate cache.

public Proxy(FluxzySetting startupSetting, ITcpConnectionProvider? tcpConnectionProvider = null, ProxyAuthenticationMethod? proxyAuthenticationMethod = null)

Parameters

startupSetting FluxzySetting

The startup Setting

tcpConnectionProvider ITcpConnectionProvider

The tcp connection provider, if null the default is used

proxyAuthenticationMethod ProxyAuthenticationMethod

Use this authentication method instead of the one provided in FluxzySetting

Properties

EndPoints

Gets the collection of IP endpoints associated with this proxy. Returns null if the proxy is not started.

public IReadOnlyCollection<IPEndPoint>? EndPoints { get; }

Property Value

IReadOnlyCollection<IPEndPoint>

Remarks

The IP endpoints represent the network addresses that the property can be accessed on.

SessionIdentifier

Get the unique identifier of this proxy instance.

public string SessionIdentifier { get; }

Property Value

string

StartupSetting

Get the setting that was used to start this proxy. Altering this setting will not affect the proxy.

public FluxzySetting StartupSetting { get; }

Property Value

FluxzySetting

Writer

Get the writer that is used by this proxy.

public RealtimeArchiveWriter Writer { get; set; }

Property Value

RealtimeArchiveWriter

Methods

DisposeAsync()

Release all resources used by this proxy.

public ValueTask DisposeAsync()

Returns

ValueTask

GetActiveRules()

Gets a read-only snapshot of currently active alteration rules. Does not include fixed rules (SSL skip, CA mount, welcome page).

public IReadOnlyCollection<Rule> GetActiveRules()

Returns

IReadOnlyCollection<Rule>

Read-only collection of active alteration rules

Exceptions

InvalidOperationException

If proxy not started

Run()

Start the proxy and return the end points that the proxy is listening to.

public IReadOnlyCollection<IPEndPoint> Run()

Returns

IReadOnlyCollection<IPEndPoint>

Returns an exhaustive list of endpoints that the proxy is listen to

Exceptions

InvalidOperationException

UpdateRules(Action<FluxzySetting>)

Updates the alteration rules at runtime using a configuration action. Provides a fluent API for configuring rules similar to FluxzySetting setup.

public void UpdateRules(Action<FluxzySetting> configureRules)

Parameters

configureRules Action<FluxzySetting>

Action to configure rules on a temporary FluxzySetting

Exceptions

InvalidOperationException

If proxy not started or disposed

ArgumentNullException

If configureRules is null

RuleInitializationException

If rule initialization fails

UpdateRules(IEnumerable<Rule>)

Updates the alteration rules at runtime without stopping the proxy. New rules apply to exchanges that begin processing after this call completes. In-flight exchanges continue with their existing rules. Fixed rules (SSL skip, CA mount, welcome page) are automatically preserved.

public void UpdateRules(IEnumerable<Rule> rules)

Parameters

rules IEnumerable<Rule>

The new set of alteration rules

Exceptions

InvalidOperationException

If proxy not started or disposed

ArgumentNullException

If rules is null

RuleInitializationException

If rule initialization fails