pub enum TransportKind {
Abridged,
Intermediate,
Full,
Obfuscated {
secret: Option<[u8; 16]>,
},
PaddedIntermediate {
secret: Option<[u8; 16]>,
},
FakeTls {
secret: [u8; 16],
domain: String,
},
Http,
}Expand description
Which MTProto wire framing to use for a connection.
| Variant | Init bytes | Notes |
|---|---|---|
Abridged | 0xEF | Lightest framing |
Intermediate | 0xEEEEEEEE | 4-byte length prefix |
Full | none | length + seqno + CRC32 |
Obfuscated | random 64B | Bypasses DPI / MTProxy: default |
PaddedIntermediate | random 64B (0xDDDDDDDD tag) | 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.
Required for 0xDD MTProxy secrets.
FakeTls
FakeTLS transport (0xEE prefix in MTProxy secret).
Wraps all MTProto data in fake TLS 1.3 records.
Http
HTTP transport fallback: sends raw MTProto frames as HTTP POST to port 80.
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