pub struct ConnectUdpRequest {
pub target_host: String,
pub target_port: u16,
pub connect_udp_bind: bool,
}Expand description
HTTP CONNECT-UDP Request
Represents an Extended CONNECT request for establishing a UDP proxy session. Can be either a targeted request (proxy to specific destination) or a bind request (request public address for inbound connections).
Fields§
§target_host: StringTarget host (“::” for bind-any)
target_port: u16Target port (0 for bind-any)
connect_udp_bind: boolWhether this is a bind request (vs. targeted proxy)
Implementations§
Source§impl ConnectUdpRequest
impl ConnectUdpRequest
Sourcepub fn bind_any() -> Self
pub fn bind_any() -> Self
Create a bind-any request
Requests the relay allocate a public address for receiving inbound connections. The relay will choose both the IP and port.
Sourcepub fn bind_port(port: u16) -> Self
pub fn bind_port(port: u16) -> Self
Create a bind request for a specific port
Requests the relay allocate a public address with a specific port. The relay may reject this if the port is unavailable.
Sourcepub fn target(addr: SocketAddr) -> Self
pub fn target(addr: SocketAddr) -> Self
Create a targeted proxy request
Requests the relay forward UDP traffic to a specific destination. This is the standard CONNECT-UDP mode (not bind).
Sourcepub fn is_bind_request(&self) -> bool
pub fn is_bind_request(&self) -> bool
Check if this is a bind request
Sourcepub fn is_bind_any(&self) -> bool
pub fn is_bind_any(&self) -> bool
Check if this is a bind-any request (both host and port unspecified)
Sourcepub fn target_addr(&self) -> Option<SocketAddr>
pub fn target_addr(&self) -> Option<SocketAddr>
Get the target socket address if this is a targeted request
Trait Implementations§
Source§impl Clone for ConnectUdpRequest
impl Clone for ConnectUdpRequest
Source§fn clone(&self) -> ConnectUdpRequest
fn clone(&self) -> ConnectUdpRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectUdpRequest
impl Debug for ConnectUdpRequest
Source§impl Display for ConnectUdpRequest
impl Display for ConnectUdpRequest
Source§impl PartialEq for ConnectUdpRequest
impl PartialEq for ConnectUdpRequest
impl Eq for ConnectUdpRequest
impl StructuralPartialEq for ConnectUdpRequest
Auto Trait Implementations§
impl Freeze for ConnectUdpRequest
impl RefUnwindSafe for ConnectUdpRequest
impl Send for ConnectUdpRequest
impl Sync for ConnectUdpRequest
impl Unpin for ConnectUdpRequest
impl UnwindSafe for ConnectUdpRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.