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
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

interfaces.go 584B

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