pub struct TcpStreamService { /* private fields */ }Expand description
TCP stream proxy service
Listens on a port and proxies TCP connections to registered backends using round-robin load balancing.
Implementations§
Source§impl TcpStreamService
impl TcpStreamService
Sourcepub fn new(registry: Arc<StreamRegistry>, listen_port: u16) -> Self
pub fn new(registry: Arc<StreamRegistry>, listen_port: u16) -> Self
Create a new TCP stream service
Sourcepub fn registry(&self) -> &Arc<StreamRegistry>
pub fn registry(&self) -> &Arc<StreamRegistry>
Get a reference to the registry
Sourcepub async fn serve(self: Arc<Self>, listener: TcpListener)
pub async fn serve(self: Arc<Self>, listener: TcpListener)
Run a standalone TCP accept loop on the given listener.
For each accepted connection, resolves a backend from the registry and spawns a task to perform bidirectional tunneling. This method runs indefinitely until the listener encounters a fatal error.
Auto Trait Implementations§
impl Freeze for TcpStreamService
impl !RefUnwindSafe for TcpStreamService
impl Send for TcpStreamService
impl Sync for TcpStreamService
impl Unpin for TcpStreamService
impl UnsafeUnpin for TcpStreamService
impl !UnwindSafe for TcpStreamService
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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