check.go 299 B

12345678910111213141516171819
  1. package proxy
  2. import (
  3. "errors"
  4. "net/url"
  5. "strings"
  6. )
  7. var errUnsupportedProxyType = errors.New("unsupported proxy type")
  8. func CheckProxyProtocolSupport(proxy *url.URL) error {
  9. switch strings.ToLower(proxy.Scheme) {
  10. case "socks5":
  11. return nil
  12. default:
  13. return errUnsupportedProxyType
  14. }
  15. }