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
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }