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.

conn.go 426B

12345678910111213141516171819202122232425
  1. package proxyprotocol
  2. import "github.com/pires/go-proxyproto"
  3. type connWrapper struct {
  4. *proxyproto.Conn
  5. }
  6. func (c connWrapper) CloseRead() error {
  7. tcpConn, ok := c.TCPConn()
  8. if !ok {
  9. panic("we support only tcp connections")
  10. }
  11. return tcpConn.CloseRead()
  12. }
  13. func (c connWrapper) CloseWrite() error {
  14. tcpConn, ok := c.TCPConn()
  15. if !ok {
  16. panic("we support only tcp connections")
  17. }
  18. return tcpConn.CloseWrite()
  19. }