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 символів.

123456789101112131415161718192021222324252627282930313233
  1. package network
  2. import (
  3. "context"
  4. "errors"
  5. "net"
  6. "time"
  7. )
  8. const (
  9. DefaultTimeout = 10 * time.Second
  10. DefaultIdleTimeout = time.Minute
  11. DefaultHTTPTimeout = 10 * time.Second
  12. DefaultBufferSize = 4096
  13. ProxyDialerOpenThreshold = 5
  14. ProxyDialerHalfOpenTimeout = time.Minute
  15. ProxyDialerResetFailuresTimeout = 10 * time.Second
  16. DefaultDOHHostname = "9.9.9.9"
  17. DNSTimeout = 5 * time.Second
  18. )
  19. var (
  20. ErrCircuitBreakerOpened = errors.New("circuit breaker is opened")
  21. ErrCannotDialWithAllProxies = errors.New("cannot dial with all proxies")
  22. )
  23. type Dialer interface {
  24. Dial(network, address string) (net.Conn, error)
  25. DialContext(ctx context.Context, network, address string) (net.Conn, error)
  26. TCPBufferSize() int
  27. }