pub struct ProxyServer { /* private fields */ }Expand description
A domain-filtering HTTP CONNECT proxy server.
Binds to 127.0.0.1 on an ephemeral port. Sandboxed processes connect through
this proxy via HTTP_PROXY/HTTPS_PROXY env vars. The proxy checks the target
domain against an allowlist before establishing the upstream tunnel.
Implementations§
Source§impl ProxyServer
impl ProxyServer
Sourcepub async fn bind(
allowlist: DomainAllowlist,
shutdown_rx: Receiver<bool>,
) -> Result<(Self, u16), ProxyError>
pub async fn bind( allowlist: DomainAllowlist, shutdown_rx: Receiver<bool>, ) -> Result<(Self, u16), ProxyError>
Create and bind a new proxy server. Returns the server and its bound port.
Sourcepub async fn run(self) -> Result<(), ProxyError>
pub async fn run(self) -> Result<(), ProxyError>
Run the proxy server until shutdown is signaled.
Auto Trait Implementations§
impl !Freeze for ProxyServer
impl RefUnwindSafe for ProxyServer
impl Send for ProxyServer
impl Sync for ProxyServer
impl Unpin for ProxyServer
impl UnsafeUnpin for ProxyServer
impl UnwindSafe for ProxyServer
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