Documentation
¶
Index ¶
Constants ¶
const TagAbridged uint32 = 0xefefefef
TagAbridged is the obfuscated2 transport tag for MTProto's abridged framing.
Variables ¶
var ErrFakeTLSAuth = fmt.Errorf("%w: authentication failed", ErrNotProxy)
ErrFakeTLSAuth is the Fake TLS-shaped response a site or decoy sends after rejecting a domain or key.
var ErrFakeTLSProtocol = fmt.Errorf("%w: invalid Fake TLS response", ErrNotProxy)
ErrFakeTLSProtocol means the response did not have the framing of a Fake TLS ServerHello.
var ErrNotProxy = errors.New("mtproto: the answer is not a Fake TLS ServerHello for this key")
ErrNotProxy means a connection did not return the keyed Fake TLS ServerHello a client expects.
Functions ¶
Types ¶
type Client ¶
type Client struct {
Conn net.Conn
// HeaderKeys are bytes 8..56 of the obfuscated2 header sent: the keys and IVs of this leg.
HeaderKeys []byte
// contains filtered or unexported fields
}
Client is a proxy connection after the Fake TLS handshake.
func StartClient ¶
StartClient sends the Fake TLS hello and validates the keyed ServerHello answer.
func (*Client) CloseWrite ¶
CloseWrite half-closes a TCP client connection.
func (*Client) SendHeader ¶
SendHeader sends the obfuscated2 abridged/intermediate/padded header for one DC.