Skip to content

Commit 0c6244c

Browse files
committed
feat: client side portion of experimental tunnel
1 parent d5470f4 commit 0c6244c

4 files changed

Lines changed: 809 additions & 0 deletions

File tree

src/api.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ struct ServerDetails {
9595
ident: Option<String>,
9696
/// Association token if the server supports providing one
9797
association: Option<String>,
98+
/// Tunnel port if the server provides one
99+
tunnel_port: Option<u16>,
98100
}
99101

100102
/// Data from completing a lookup contains the resolved address
@@ -108,6 +110,8 @@ pub struct LookupData {
108110
pub version: Version,
109111
/// Association token if the server supports providing one
110112
pub association: Option<String>,
113+
/// Tunnel port if the server provides one
114+
pub tunnel_port: Option<u16>,
111115
}
112116

113117
/// Errors that can occur while looking up a server
@@ -229,6 +233,7 @@ pub async fn lookup_server(
229233
url,
230234
version: details.version,
231235
association: details.association,
236+
tunnel_port: details.tunnel_port,
232237
})
233238
}
234239

src/ctx.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ pub struct ClientContext {
1111
pub base_url: Url,
1212
/// Optional association token
1313
pub association: Option<String>,
14+
/// Optional tunnel port for tunnel V2 if available
15+
pub tunnel_port: Option<u16>,
1416
}

src/servers/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub mod qos;
1010
pub mod redirector;
1111
pub mod telemetry;
1212
pub mod tunnel;
13+
pub mod udp_tunnel;
1314

1415
/// The port the Redirector server will bind to
1516
pub const REDIRECTOR_PORT: u16 = 42127;

0 commit comments

Comments
 (0)