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

stream_info.go 536B

12345678910111213141516171819202122232425262728293031
  1. package stats
  2. import (
  3. "net"
  4. "time"
  5. )
  6. type streamInfo struct {
  7. createdAt time.Time
  8. clientIP net.IP
  9. remoteIP net.IP
  10. dc int
  11. bytesSentToTelegram uint
  12. bytesRecvFromTelegram uint
  13. }
  14. func (s *streamInfo) GetClientIPType() string {
  15. return s.getIPType(s.clientIP)
  16. }
  17. func (s *streamInfo) GetRemoteIPType() string {
  18. return s.getIPType(s.remoteIP)
  19. }
  20. func (s *streamInfo) getIPType(ip net.IP) string {
  21. if ip.To4() == nil {
  22. return TagIPTypeIPv6
  23. }
  24. return TagIPTypeIPv4
  25. }