mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add common proxy utilities
This commit is contained in:
parent
6b0421db0d
commit
8b46e60553
4 changed files with 296 additions and 2 deletions
18
common/proxy/check.go
Normal file
18
common/proxy/check.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package proxy
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var errUnsupportedProxyType = errors.New("unsupported proxy type")
|
||||
|
||||
func CheckProxyProtocolSupport(proxy *url.URL) error {
|
||||
switch strings.ToLower(proxy.Scheme) {
|
||||
case "socks5":
|
||||
return nil
|
||||
default:
|
||||
return errUnsupportedProxyType
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue