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
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425
  1. package client
  2. import (
  3. "net"
  4. "github.com/9seconds/mtg/config"
  5. "github.com/9seconds/mtg/mtproto"
  6. mtwrappers "github.com/9seconds/mtg/mtproto/wrappers"
  7. "github.com/9seconds/mtg/wrappers"
  8. )
  9. func MiddleInit(conn net.Conn, conf *config.Config) (*mtproto.ConnectionOpts, wrappers.ReadWriteCloserWithAddr, error) {
  10. opts, newConn, err := DirectInit(conn, conf)
  11. if err != nil {
  12. return nil, nil, err
  13. }
  14. if opts.ConnectionType == mtproto.ConnectionTypeAbridged {
  15. newConn = mtwrappers.NewAbridgedRWC(newConn, opts)
  16. } else {
  17. newConn = mtwrappers.NewIntermediateRWC(newConn, opts)
  18. }
  19. return opts, newConn, nil
  20. }