pub struct RunningProxy { /* private fields */ }Expand description
One owned proxy generation and all of its listener/client work.
Implementations§
Source§impl RunningProxy
impl RunningProxy
Sourcepub fn start(
config: ProxyConfig,
backend: Arc<dyn ProxyBackend>,
observer: Arc<dyn ProxyObserver>,
) -> Result<Self, ProxyError>
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.
Sourcepub fn start_with_metadata_observer(
config: ProxyConfig,
backend: Arc<dyn ProxyBackend>,
observer: Arc<dyn ProxyObserver>,
metadata_observer: Arc<dyn ProxyResponseMetadataObserver>,
) -> Result<Self, ProxyError>
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.
pub fn endpoint(&self) -> &ProxyEndpoint
pub fn active_clients(&self) -> usize
pub fn is_stopped(&self) -> bool
pub fn is_stop_requested(&self) -> bool
Sourcepub fn matches_authentication_challenge(
&self,
host: &str,
port: u16,
realm: &str,
) -> bool
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.
Sourcepub fn local_certificate_pin(&self, host: &str) -> Option<LocalCertificatePin>
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.
Sourcepub fn matches_local_certificate(
&self,
host: &str,
certificate_der: &[u8],
) -> bool
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.
Sourcepub fn request_stop(&self)
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.
Sourcepub fn stop(&self)
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.