pub enum DialMode {
Direct,
Tls {
pinned_cert_der: Option<Vec<u8>>,
},
Socks5 {
proxy: String,
},
}Expand description
How to physically open the WebSocket to a relay URL. Generalizes the old
if url.contains(".onion") { socks } else { direct } branch.
Variants§
Direct
Plain TCP → ws:// (clearnet, no Tor, no TLS). Fast; the relay sees
your IP and on-path observers see the WebSocket (the payload is still
end-to-end encrypted). The easiest thing for a censor to block.
Tls
rustls TLS → wss:// (clearnet, TLS). pinned_cert_der would pin a
self-signed cert; None uses the system trust store (a real cert via
Caddy / Let’s Encrypt / Cloudflare — the recommended clearnet setup).
Socks5
SOCKS5 to a local Tor (the system tor, optionally configured with a
bridge to punch through censorship). Hides your IP from the relay.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DialMode
impl RefUnwindSafe for DialMode
impl Send for DialMode
impl Sync for DialMode
impl Unpin for DialMode
impl UnsafeUnpin for DialMode
impl UnwindSafe for DialMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more