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.

adapter.go 311B

1234567891011121314151617181920
  1. package proxyprotocol
  2. import (
  3. "net"
  4. "github.com/pires/go-proxyproto"
  5. )
  6. type ListenerAdapter struct {
  7. proxyproto.Listener
  8. }
  9. func (l *ListenerAdapter) Accept() (net.Conn, error) {
  10. conn, err := l.Listener.Accept()
  11. if err != nil {
  12. return nil, err
  13. }
  14. return connWrapper{conn.(*proxyproto.Conn)}, nil
  15. }