pub struct LocalProxy { /* private fields */ }Expand description
A local HTTP CONNECT proxy.
WebView ──CONNECT──▶ LocalProxy ──(router)──▶ Direct / SOCKS5 upstreamClone is cheap (Arc-backed). Pass one clone to tokio::spawn(proxy.run()),
keep the other for set_router() / set_capture_ca() calls.
Implementations§
Source§impl LocalProxy
impl LocalProxy
Sourcepub async fn bind(
addr: &str,
initial_router: Arc<dyn ProxyRouter>,
) -> Result<Self, ProxyError>
pub async fn bind( addr: &str, initial_router: Arc<dyn ProxyRouter>, ) -> Result<Self, ProxyError>
Bind on addr (use "127.0.0.1:0" to let the OS pick a free port).
pub fn local_addr(&self) -> SocketAddr
Sourcepub fn set_router(&self, router: Arc<dyn ProxyRouter>)
pub fn set_router(&self, router: Arc<dyn ProxyRouter>)
Swap the routing policy. Takes effect for all new connections.
Trait Implementations§
Source§impl Clone for LocalProxy
impl Clone for LocalProxy
Source§fn clone(&self) -> LocalProxy
fn clone(&self) -> LocalProxy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LocalProxy
impl RefUnwindSafe for LocalProxy
impl Send for LocalProxy
impl Sync for LocalProxy
impl Unpin for LocalProxy
impl UnsafeUnpin for LocalProxy
impl UnwindSafe for LocalProxy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more