pub struct UdpProxy { /* private fields */ }Expand description
Layer-4 (raw UDP) reverse proxy with round-robin load balancing.
Each client datagram is forwarded to one backend; the backend’s reply is delivered back to the originating client address. No session state is kept between datagrams.
Call UdpProxy::bind to start. It blocks the calling thread indefinitely.
Implementations§
Source§impl UdpProxy
impl UdpProxy
Sourcepub fn new<I, S>(backends: I) -> Self
pub fn new<I, S>(backends: I) -> Self
Create a proxy that distributes datagrams across backends in
round-robin order. Each entry must be "host:port".
Sourcepub fn reply_timeout_ms(self, ms: u64) -> Self
pub fn reply_timeout_ms(self, ms: u64) -> Self
Override the timeout waiting for a backend reply (default: 5 s).
Sourcepub fn buffer_size(self, bytes: usize) -> Self
pub fn buffer_size(self, bytes: usize) -> Self
Override the per-datagram buffer size (default: 65 536 B).
Auto Trait Implementations§
impl Freeze for UdpProxy
impl RefUnwindSafe for UdpProxy
impl Send for UdpProxy
impl Sync for UdpProxy
impl Unpin for UdpProxy
impl UnsafeUnpin for UdpProxy
impl UnwindSafe for UdpProxy
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