Skip to main content

RunningProxy

Struct RunningProxy 

Source
pub struct RunningProxy { /* private fields */ }
Expand description

One owned proxy generation and all of its listener/client work.

Implementations§

Source§

impl RunningProxy

Source

pub fn start( config: ProxyConfig, backend: Arc<dyn ProxyBackend>, observer: Arc<dyn ProxyObserver>, ) -> Result<Self, ProxyError>

Starts a fresh authenticated proxy on an operating-system-selected IPv4 loopback port.

Source

pub fn start_with_metadata_observer( config: ProxyConfig, backend: Arc<dyn ProxyBackend>, observer: Arc<dyn ProxyObserver>, metadata_observer: Arc<dyn ProxyResponseMetadataObserver>, ) -> Result<Self, ProxyError>

Starts a fresh authenticated proxy with an independent observer for trusted metadata removed from validated browser response heads.

Source

pub fn endpoint(&self) -> &ProxyEndpoint

Source

pub fn active_clients(&self) -> usize

Source

pub fn is_stopped(&self) -> bool

Source

pub fn is_stop_requested(&self) -> bool

Source

pub fn matches_authentication_challenge( &self, host: &str, port: u16, realm: &str, ) -> bool

Matches a platform proxy-authentication challenge only while this generation remains live and unrevoked.

Source

pub fn local_certificate_pin(&self, host: &str) -> Option<LocalCertificatePin>

Returns informational, generation-bound pin metadata after an authenticated CONNECT has prepared this exact canonical host. The pin cannot authorize certificate DER; native trust hooks must call Self::matches_local_certificate through this live proxy handle.

Source

pub fn matches_local_certificate( &self, host: &str, certificate_der: &[u8], ) -> bool

Verifies browser challenge DER against the active generation’s exact host identity. Unknown, malformed, oversized, or stopped lookups fail.

Source

pub fn request_stop(&self)

Cancels socket/backend work and, from an external control thread, joins the listener and every client worker. Repeated and concurrent calls are safe. A reentrant observer callback requests cancellation; the next external call completes the join.

Source

pub fn stop(&self)

Requests immediate revocation and cancellation, then joins the listener and every client worker. Platform UI threads may call Self::request_stop first and complete this blocking join on a lifecycle worker.

Trait Implementations§

Source§

impl Debug for RunningProxy

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for RunningProxy

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.