internal

package
v0.0.0-...-08f1a79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

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 Fetch

func Fetch(proto, src string, transformer Transformer, parser Parser) int

func FromBase64

func FromBase64(buf []byte) []byte

func FromRaw

func FromRaw(buf []byte) []byte

func IsLocal

func IsLocal(ip string) bool

func Load

func Load(proto string, content []byte) error

func RegisterParser

func RegisterParser(name string, parser Parser)

func RegisterTransformer

func RegisterTransformer(name string, t Transformer)

func Save

func Save(it *Proxy)

func WriteTo

func WriteTo(dir string)

func WriteTotalAndUpdateReadme

func WriteTotalAndUpdateReadme(dir string, counters map[string]int)

Types

type Parser

type Parser func(string, string) (*Proxy, error)

func GetParser

func GetParser(name string) Parser

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 ParseColonURL(proto, proxyURL string) (*Proxy, error)

func ParseProxyURL

func ParseProxyURL(proto, proxyURL string) (*Proxy, error)

func ParseSpaceURL

func ParseSpaceURL(proto, proxyURL string) (*Proxy, error)

func (*Proxy) String

func (p *Proxy) String() string

type Transformer

type Transformer func([]byte) []byte

func GetTransformer

func GetTransformer(name string) Transformer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL