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.

12345678910111213141516171819202122232425
  1. package network
  2. import (
  3. "context"
  4. "errors"
  5. "net"
  6. "time"
  7. )
  8. const (
  9. DefaultTimeout = 10 * time.Second
  10. DefaultDNSTimeout = time.Second
  11. DefaultHTTPTimeout = DefaultTimeout
  12. DefaultBufferSize = 4096
  13. )
  14. var (
  15. ErrCircuitBreakerOpened = errors.New("circuit breaker is opened")
  16. ErrCannotDialWithAllProxies = errors.New("cannot dial with all proxies")
  17. )
  18. type Dialer interface {
  19. Dial(network, address string) (net.Conn, error)
  20. DialContext(ctx context.Context, network, address string) (net.Conn, error)
  21. }