Documentation
¶
Overview ¶
Package mtproto is the panel half of the Telegram MTProto proxy plugin: the profile schema, validation, node-side inbound construction, credential issuing and the tg://proxy link.
Index ¶
- Constants
- type FakeTLSNames
- type NodeSettings
- type Protocol
- func (*Protocol) BuildInbound(in protocols.InboundInput) (plugin.InboundSpec, error)
- func (*Protocol) Clients() []plugin.ClientSupport
- func (*Protocol) DefaultSettings() (json.RawMessage, error)
- func (*Protocol) DisplayName() string
- func (*Protocol) Doctor() []protocols.Check
- func (*Protocol) Experimental() bool
- func (*Protocol) ID() string
- func (*Protocol) IssueCredential(protocols.IssueInput) (protocols.Issued, error)
- func (*Protocol) Render(in protocols.RenderInput) (plugin.Fragment, bool)
- func (*Protocol) SettingsSchema() []byte
- func (p *Protocol) Summary(raw json.RawMessage) string
- func (*Protocol) Validate(raw json.RawMessage) []protocols.FieldError
- type Settings
Constants ¶
const ( FallbackDecoy = "decoy" FallbackSite = "site" )
What the node does with a connection that is not a client: Fallback decoy answers with the node's own site, site forwards it to the chosen site, so a prober sees that site and its certificate.
const ID = "mtproto"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeTLSNames ¶
FakeTLSNames is where the name inside the Fake TLS handshake (the domain at the end of the ee secret) comes from. Kind own: the node's own host name, or the one set on the inbound; a node with only an IP address cannot use it. Kind site: Domain, a real site that is not this server's. A document that names a domain and no kind (read before the field existed) is site.
type NodeSettings ¶
NodeSettings is the JSON the node engine receives in InboundSpec.Settings. Domains are the names a client may put in the Fake TLS handshake (one today); Fallback is FallbackDecoy for the node's own name and FallbackSite for another site, which the node reaches at Domains[0]:443. Field order is deterministic because the bytes feed the state hash.
type Protocol ¶
type Protocol struct{}
func (*Protocol) BuildInbound ¶
func (*Protocol) BuildInbound(in protocols.InboundInput) (plugin.InboundSpec, error)
func (*Protocol) Clients ¶
func (*Protocol) Clients() []plugin.ClientSupport
func (*Protocol) DefaultSettings ¶
func (*Protocol) DefaultSettings() (json.RawMessage, error)
func (*Protocol) DisplayName ¶
func (*Protocol) Experimental ¶
Experimental: the first Go port of the protocol, not proven in the field yet.
func (*Protocol) IssueCredential ¶
IssueCredential makes one MTProto key. Secret is the key in hex (what the panel stores sealed); the client link secret (ee + key + SNI in hex) is built from it when the link is rendered, because the SNI depends on the node. NodeData is what the node stores.
func (*Protocol) Render ¶
Render returns one tg://proxy link, for FormatTelegramLink only. Every subscription format answers false: a tg:// line would be a bogus server in Happ and in every other app of the link.
func (*Protocol) SettingsSchema ¶
func (*Protocol) Validate ¶
func (*Protocol) Validate(raw json.RawMessage) []protocols.FieldError
type Settings ¶
type Settings struct {
Port int `json:"port"`
FakeTLS FakeTLSNames `json:"fake_tls"`
}
Settings is the merged profile settings document.