pub struct ObfuscatedStream { /* private fields */ }Expand description
Wraps a TcpStream with obfuscated MTProto2 framing.
After construction the initial 64-byte header has already been sent and the stream is ready for abridged MTProto messages.
Implementations§
Source§impl ObfuscatedStream
impl ObfuscatedStream
Sourcepub async fn connect(
addr: &str,
proxy_secret: Option<&[u8; 16]>,
) -> Result<Self, InvocationError>
pub async fn connect( addr: &str, proxy_secret: Option<&[u8; 16]>, ) -> Result<Self, InvocationError>
Connect to addr and perform the obfuscated handshake.
proxy_secret is the MTProxy secret (32 bytes hex-decoded). Pass
None / zeros to use plain obfuscation without a proxy secret.
Auto Trait Implementations§
impl !Freeze for ObfuscatedStream
impl RefUnwindSafe for ObfuscatedStream
impl Send for ObfuscatedStream
impl Sync for ObfuscatedStream
impl Unpin for ObfuscatedStream
impl UnsafeUnpin for ObfuscatedStream
impl UnwindSafe for ObfuscatedStream
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> 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