package transport

Import Path (on

Dependency Relation
	imports 15 packages, and imported by 4 packages

Involved Source Files codec.go connection.go detect_codec.go Package transport contains different MTProto transport implementations. listener.go obfuscated.go once_close.go protocol.go websocket.go
Package-Level Type Names (total 11, in which 4 are exported)
/* sort exporteds by: | */
Codec is MTProto transport protocol encoding abstraction. Read fills buffer with received message. ReadHeader reads protocol tag if needed. Write encode to writer message from given buffer. WriteHeader sends protocol tag if needed. (interface) * (interface) Codec : func Protocol.Codec() Codec func Protocol.CodecNoHeader() Codec func Codec
Conn is transport connection. ( Conn) Close() error ( Conn) Recv(ctx context.Context, b *bin.Buffer) error ( Conn) Send(ctx context.Context, b *bin.Buffer) error Conn : io.Closer func Listener.Accept() (_ Conn, rErr error) func Protocol.Handshake(conn net.Conn) (Conn, error) func Protocol.Pipe() (a, b Conn) func net.Conn) (Conn, error) func context.Context, dc int, list dcs.List) (Conn, error) func context.Context, dc int, list dcs.List) (Conn, error) func context.Context, dc int, list dcs.List) (Conn, error) func Conn, dc int) exchange.Exchanger
Listener is a simple net.Listener wrapper for listening MTProto transport connections. Accept waits for and returns the next connection to the listener. Addr returns the listener's network address. Close closes the listener. Any blocked Accept operations will be unblocked and return errors. Listener : io.Closer func Listen(listener net.Listener) Listener func ListenCodec(codec func() Codec, listener net.Listener) Listener
Protocol is MTProto transport protocol. See Codec creates new codec using protocol settings. CodecNoHeader is Codec without header. Handshake inits given net.Conn as MTProto connection. Pipe creates an in-memory MTProto connection. Protocol : func NewProtocol(getCodec func() Codec) Protocol var Abridged var Full var Intermediate var PaddedIntermediate
Package-Level Functions (total 6, in which 5 are exported)
Listen creates new Listener using given net.Listener. Transport codec will be detected automatically.
ListenCodec creates new Listener using given net.Listener. Listener will always use given Codec constructor.
NewProtocol creates new transport protocol using user Codec constructor. See
ObfuscatedListener creates new obfuscated2 listener using given net.Listener. Useful for creating Telegram servers: transport.Listen(transport.ObfuscatedListener(ln))
WebsocketListener creates new MTProto Websocket listener.
Package-Level Variables (total 4, all are exported)
Abridged is abridged transport protocol. See
Full is full transport protocol. See
Intermediate is intermediate transport protocol. See
PaddedIntermediate is padded intermediate transport protocol. See