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
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

socks5.go 514B

123456789101112131415161718192021
  1. package network
  2. import (
  3. "fmt"
  4. "net/url"
  5. "golang.org/x/net/proxy"
  6. )
  7. // NewSocks5Dialer build a new dialer from a given one (so, in theory
  8. // you can chain here). Proxy parameters are passed with URI in a form of:
  9. //
  10. // socks5://[user:[password]]@host:port
  11. func NewSocks5Dialer(baseDialer Dialer, proxyURL *url.URL) (Dialer, error) {
  12. rv, err := proxy.FromURL(proxyURL, baseDialer)
  13. if err != nil {
  14. return nil, fmt.Errorf("cannot initialize socks5 proxy dialer: %w", err)
  15. }
  16. return rv.(Dialer), nil
  17. }