pub struct NetherNetProxy { /* private fields */ }Expand description
Forwards NetherNet’s TCP signaling connections to a NetherNet-capable server.
The client must still be able to reach the backend’s advertised WebRTC ICE candidate directly for gameplay. This is useful when the signaling endpoint needs a different local address or port from the backend.
§Example
let proxy = rust_raknet::NetherNetProxy::bind(
"127.0.0.1:19144".parse().unwrap(),
"127.0.0.1:19142".parse().unwrap(),
).await?;
proxy.run().awaitImplementations§
Source§impl NetherNetProxy
impl NetherNetProxy
Sourcepub async fn bind(listen: SocketAddr, upstream: SocketAddr) -> Result<Self>
pub async fn bind(listen: SocketAddr, upstream: SocketAddr) -> Result<Self>
Binds a TCP signaling endpoint and forwards each connection to upstream.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the local TCP address used for NetherNet signaling.
Sourcepub fn with_connection_limit(self, limit: NonZeroUsize) -> Self
pub fn with_connection_limit(self, limit: NonZeroUsize) -> Self
Sets the maximum number of simultaneous signaling connections (default: 1024).
Auto Trait Implementations§
impl !Freeze for NetherNetProxy
impl RefUnwindSafe for NetherNetProxy
impl Send for NetherNetProxy
impl Sync for NetherNetProxy
impl Unpin for NetherNetProxy
impl UnsafeUnpin for NetherNetProxy
impl UnwindSafe for NetherNetProxy
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