Documentation
¶
Index ¶
- Constants
- Variables
- func Fetch(proto, src string, transformer Transformer, parser Parser) int
- func FromBase64(buf []byte) []byte
- func FromRaw(buf []byte) []byte
- func IsLocal(ip string) bool
- func Load(proto string, content []byte) error
- func RegisterParser(name string, parser Parser)
- func RegisterTransformer(name string, t Transformer)
- func Save(it *Proxy)
- func WriteTo(dir string)
- func WriteTotalAndUpdateReadme(dir string, counters map[string]int)
- type Parser
- type Proxy
- type Transformer
Constants ¶
View Source
const ( // MaxSchemeLength defines the maximum allowed length for proxy scheme. // Legitimate proxy protocols (http, https, socks4, socks5, vmess, trojan, vless, ss, ssr, hy, hy2) // are all 6 characters or less. 15 provides safe headroom for future protocols. MaxSchemeLength = 15 )
Variables ¶
View Source
var ( Parsers = map[string]Parser{} ErrInvalidProxy = errors.New("gfp: invalid proxy") )
View Source
var (
Transformers = map[string]Transformer{}
)
Functions ¶
func FromBase64 ¶
func RegisterParser ¶
func RegisterTransformer ¶
func RegisterTransformer(name string, t Transformer)
Types ¶
type Proxy ¶
type Proxy struct {
IP string `json:"ip"`
Port int `json:"port"`
User string `json:"user"`
Passwd string `json:"passwd"`
Opaque string `json:"opaque"`
Protocol string `json:"protocol"`
}
func ParseColonURL ¶
func ParseProxyURL ¶
func ParseSpaceURL ¶
type Transformer ¶
func GetTransformer ¶
func GetTransformer(name string) Transformer
Click to show internal directories.
Click to hide internal directories.