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) -> UdpProxy
pub fn new<I, S>(backends: I) -> UdpProxy
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) -> UdpProxy
pub fn reply_timeout_ms(self, ms: u64) -> UdpProxy
Override the timeout waiting for a backend reply (default: 5 s).
Sourcepub fn buffer_size(self, bytes: usize) -> UdpProxy
pub fn buffer_size(self, bytes: usize) -> UdpProxy
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