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

12345678910111213141516171819202122232425
  1. package network
  2. import (
  3. "crypto/tls"
  4. "net/http"
  5. )
  6. type networkHTTPTransport struct {
  7. userAgent string
  8. next http.RoundTripper
  9. }
  10. func (n networkHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) {
  11. req.Header.Set("User-Agent", n.userAgent)
  12. return n.next.RoundTrip(req) //nolint: wrapcheck
  13. }
  14. func (n networkHTTPTransport) TrustTLS() {
  15. tr := n.next.(*http.Transport)
  16. if tr.TLSClientConfig == nil {
  17. tr.TLSClientConfig = &tls.Config{}
  18. }
  19. tr.TLSClientConfig.InsecureSkipVerify = true
  20. }