pub struct TransparentProxy {
config: ProxyConfig,
observer: Arc<dyn ProxyObserver>,
hook: Arc<dyn ProxyHook>,
cancel: CancellationToken,
next_session_id: AtomicU64,
}Expand description
A transparent MoQT proxy that accepts client connections and forwards traffic to an upstream relay.
Each accepted connection spawns a ProxySession that handles
bidirectional stream forwarding with inline MoQT frame parsing.
Fields§
§config: ProxyConfig§observer: Arc<dyn ProxyObserver>§hook: Arc<dyn ProxyHook>§cancel: CancellationToken§next_session_id: AtomicU64Implementations§
Source§impl TransparentProxy
impl TransparentProxy
Sourcepub fn new(config: ProxyConfig, observer: Arc<dyn ProxyObserver>) -> Self
pub fn new(config: ProxyConfig, observer: Arc<dyn ProxyObserver>) -> Self
Create a new proxy with the given configuration and observer.
Sourcepub fn with_hook(
config: ProxyConfig,
observer: Arc<dyn ProxyObserver>,
hook: Arc<dyn ProxyHook>,
) -> Self
pub fn with_hook( config: ProxyConfig, observer: Arc<dyn ProxyObserver>, hook: Arc<dyn ProxyHook>, ) -> Self
Create a new proxy with a custom hook for frame mutation.
Sourcepub fn cancel_token(&self) -> CancellationToken
pub fn cancel_token(&self) -> CancellationToken
Returns a cancellation token that can be used to trigger shutdown.
Sourcepub async fn run(&self) -> Result<(), ProxyError>
pub async fn run(&self) -> Result<(), ProxyError>
Run the proxy accept loop. Blocks until cancelled or a fatal listener error occurs.
Sourceasync fn run_quic(&self) -> Result<(), ProxyError>
async fn run_quic(&self) -> Result<(), ProxyError>
Run the QUIC accept loop.
fn next_session_id(&self) -> SessionId
fn emit_session_started(&self, session_id: SessionId, client_addr: SocketAddr)
fn new_session( &self, session_id: SessionId, client_alpn: Vec<u8>, ) -> ProxySession
Auto Trait Implementations§
impl !Freeze for TransparentProxy
impl !RefUnwindSafe for TransparentProxy
impl Send for TransparentProxy
impl Sync for TransparentProxy
impl Unpin for TransparentProxy
impl UnsafeUnpin for TransparentProxy
impl !UnwindSafe for TransparentProxy
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