pub enum TransportKind {
Abridged,
Intermediate,
Full,
Obfuscated {
secret: Option<[u8; 16]>,
},
PaddedIntermediate {
secret: Option<[u8; 16]>,
},
FakeTls {
secret: [u8; 16],
domain: String,
},
}Expand description
Which MTProto transport framing to use for all connections.
| Variant | Init bytes | Notes |
|---|---|---|
Abridged | 0xef | Smallest overhead |
Intermediate | 0xeeeeeeee | Better proxy compat |
Full | none | Adds seqno + CRC32 |
Obfuscated | random 64B | Bypasses DPI / MTProxy: default |
PaddedIntermediate | random 64B (0xDDDDDDDD tag) | Obfuscated padded intermediate required for 0xDD MTProxy secrets |
FakeTls | TLS 1.3 ClientHello | Most DPI-resistant; required for 0xEE MTProxy secrets |
Variants§
Abridged
MTProto Abridged transport: length prefix is 1 or 4 bytes.
Intermediate
MTProto Intermediate transport: 4-byte LE length prefix.
Full
MTProto Full transport: 4-byte length + seqno + CRC32.
Obfuscated
Obfuscated2 transport: AES-256-CTR over Abridged framing. Required for MTProxy and networks with deep-packet inspection. Default: works on all networks, bypasses DPI, negligible CPU cost.
secret is the 16-byte MTProxy secret, or None for keyless obfuscation.
PaddedIntermediate
Obfuscated PaddedIntermediate transport (0xDDDDDDDD tag in nonce).
Same AES-256-CTR obfuscation as Obfuscated, but uses Intermediate
framing and appends 0–15 random padding bytes to each frame so that
all frames are not 4-byte multiples. Required for 0xDD MTProxy secrets.
FakeTls
FakeTLS transport (0xEE prefix in MTProxy secret).
Wraps all MTProto data in fake TLS 1.3 records. The ClientHello
embeds an HMAC-SHA256 digest of the secret so the MTProxy server
can validate ownership without decrypting real TLS. Most DPI-resistant
mode; required for 0xEE MTProxy secrets.
Trait Implementations§
Source§impl Clone for TransportKind
impl Clone for TransportKind
Source§fn clone(&self) -> TransportKind
fn clone(&self) -> TransportKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransportKind
impl Debug for TransportKind
Auto Trait Implementations§
impl Freeze for TransportKind
impl RefUnwindSafe for TransportKind
impl Send for TransportKind
impl Sync for TransportKind
impl Unpin for TransportKind
impl UnsafeUnpin for TransportKind
impl UnwindSafe for TransportKind
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<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>
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>
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