Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

interfaces.go 521B

1234567891011121314151617181920
  1. package protocol
  2. import (
  3. "github.com/9seconds/mtg/conntypes"
  4. "github.com/9seconds/mtg/wrappers"
  5. )
  6. type ClientProtocol interface {
  7. Handshake(wrappers.StreamReadWriteCloser) (wrappers.StreamReadWriteCloser, error)
  8. ConnectionType() conntypes.ConnectionType
  9. ConnectionProtocol() conntypes.ConnectionProtocol
  10. DC() conntypes.DC
  11. }
  12. type TelegramProtocol interface {
  13. Handshake(*TelegramRequest) (wrappers.Wrap, error)
  14. }
  15. type ClientProtocolMaker func() ClientProtocol
  16. type TelegramProtocolMaker func() TelegramProtocol