mtproto

package
v0.1.69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: AGPL-3.0 Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mtproto is the node's Telegram MTProto proxy engine: one TCP listener per inbound, Fake TLS authentication and a direct relay to a Telegram DC (the protocol is internal/mtproto). Whoever connects without a valid Fake TLS hello gets a real website, so the port looks like an ordinary HTTPS server: the node's own decoy site (fallback "decoy", the domain is the node's) or someone else's site, spliced through raw (fallback "site", the domain is that site's). See fallback.go.

Index

Constants

View Source
const Protocol = "mtproto"
View Source
const Version = "go-mtproto 0.2"

Variables

View Source
var BindIP net.IP

BindIP is nil in production (all interfaces). Tests bind to loopback.

View Source
var Factory engine.Factory = New

Functions

func New

func New(env engine.Env) (engine.Engine, error)

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func (*Engine) Apply

func (e *Engine) Apply(ctx context.Context, spec plugin.InboundSpec, creds []plugin.UserCred) (engine.ApplyReport, error)

func (*Engine) Capabilities

func (*Engine) Capabilities() engine.Capabilities

func (*Engine) Close

func (e *Engine) Close(ctx context.Context) error

func (*Engine) Collect

func (e *Engine) Collect(ctx context.Context) (engine.Collected, error)

func (*Engine) Health

func (e *Engine) Health() []plugin.EngineHealth

func (*Engine) Kick

func (e *Engine) Kick(ctx context.Context, credIDs []string) (int, error)

func (*Engine) Observed

func (e *Engine) Observed() []statehash.Inbound

func (*Engine) Protocol

func (*Engine) Protocol() string

func (*Engine) Remove

func (e *Engine) Remove(ctx context.Context, inboundID string) error

func (*Engine) Version

func (*Engine) Version() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL