pub struct TunnelClient { /* private fields */ }Expand description
Builder for configuring and connecting a tunnel client.
Implementations§
Source§impl TunnelClient
impl TunnelClient
pub fn new(server_url: impl Into<String>, local_addr: SocketAddr) -> Self
Sourcepub fn subdomain(self, subdomain: impl Into<String>) -> Self
pub fn subdomain(self, subdomain: impl Into<String>) -> Self
Request a specific subdomain (e.g. “myapp” → myapp.yourdomain.com).
Sourcepub async fn connect(self) -> Result<TunnelHandle>
pub async fn connect(self) -> Result<TunnelHandle>
Connect to the tunnel server and start forwarding traffic.
Returns a TunnelHandle with the assigned public URL.
The client automatically reconnects with exponential backoff if the
connection is lost (e.g. server restart). Reconnection stops when
TunnelHandle::close is called.
Auto Trait Implementations§
impl Forget for TunnelClient
impl Freeze for TunnelClient
impl RefUnwindSafe for TunnelClient
impl Send for TunnelClient
impl Sync for TunnelClient
impl Unpin for TunnelClient
impl UnsafeUnpin for TunnelClient
impl UnwindSafe for TunnelClient
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