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
- Variables
- func New(env engine.Env) (engine.Engine, error)
- type Engine
- func (e *Engine) Apply(ctx context.Context, spec plugin.InboundSpec, creds []plugin.UserCred) (engine.ApplyReport, error)
- func (*Engine) Capabilities() engine.Capabilities
- func (e *Engine) Close(ctx context.Context) error
- func (e *Engine) Collect(ctx context.Context) (engine.Collected, error)
- func (e *Engine) Health() []plugin.EngineHealth
- func (e *Engine) Kick(ctx context.Context, credIDs []string) (int, error)
- func (e *Engine) Observed() []statehash.Inbound
- func (*Engine) Protocol() string
- func (e *Engine) Remove(ctx context.Context, inboundID string) error
- func (*Engine) Version() string
Constants ¶
const Protocol = "mtproto"
const Version = "go-mtproto 0.2"
Variables ¶
var BindIP net.IP
BindIP is nil in production (all interfaces). Tests bind to loopback.
var Factory engine.Factory = New
Functions ¶
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) Health ¶
func (e *Engine) Health() []plugin.EngineHealth