proxy

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSRServer = iota
	SSRPort
	SSRProtocol
	SSRCipher // ssr的method
	SSROBFS
	SSRSuffix
)

Variables

View Source
var (
	SsCiphers  = []string{"rc4-md5", "aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "bf-cfb", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "salsa20", "chacha20", "chacha20-ietf", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "2022-blake3-chacha12-poly1305", "2022-blake3-chacha8-poly1305"}
	SsrCiphers = []string{"none", "table", "rc4", "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "salsa20", "chacha20", "chacha20-ietf"}
)

Functions

func ClashToString

func ClashToString(proxyList ProxyList) string

func ProxieToClash

func ProxieToClash(node Proxy) map[string]any

func ProxieToSurge added in v0.0.3

func ProxieToSurge(node Proxy) string

ProxieToSurge 将单个代理转换为 Surge 配置格式的字符串

func SsToString added in v0.0.2

func SsToString(proxyList ProxyList) string

SsToString 将代理列表中的 ss 代理转换为 Base64 编码的字符串

func SsrToString added in v0.0.2

func SsrToString(proxyList ProxyList) string

SsrToString 将代理列表中的 ssr/ss 代理转换为 Base64 编码的字符串

func SurgeToString added in v0.0.3

func SurgeToString(proxyList ProxyList) string

SurgeToString 将代理列表转换为 Surge 配置格式的字符串

func TrojanToString added in v0.0.2

func TrojanToString(proxyList ProxyList) string

TrojanToString 将代理列表中的 trojan 代理转换为 Base64 编码的字符串

func V2rayToString added in v1.0.0

func V2rayToString(proxyList ProxyList) string

TrojanToString 将代理列表中的 trojan 代理转换为 Base64 编码的字符串

func VmessToString added in v0.0.2

func VmessToString(proxyList ProxyList) string

VmessToString 将代理列表中的 vmess 代理转换为 Base64 编码的字符串

Types

type HTTPProxy added in v1.0.0

type HTTPProxy struct {
	Group          string  `json:"group,omitempty"`
	Name           string  `json:"name,omitempty"`
	Server         string  `json:"server,omitempty"`
	Port           int     `json:"port,omitempty"`
	Username       string  `json:"username,omitempty"`
	Password       string  `json:"password,omitempty"`
	TLSSecure      bool    `json:"tlsSecure,omitempty"`
	UDP            bool    `json:"udp,omitempty"`
	TCPFastOpen    bool    `json:"tfo,omitempty"`
	SkipCertVerify bool    `json:"skipCertVerify,omitempty"`
	Country        string  `json:"country,omitempty"`
	Speed          float64 `json:"speed,omitempty"`
	IsValidFlag    bool    `json:"isValidFlag,omitempty"`
	OriginName     string  `json:"-,omitempty"` // 原始名称
}

HTTPProxy http 代理结构体

func (*HTTPProxy) GetCountry added in v1.0.0

func (h *HTTPProxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法

func (*HTTPProxy) GetIdentifier added in v1.0.0

func (h *HTTPProxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法

func (*HTTPProxy) GetName added in v1.0.0

func (h *HTTPProxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法

func (*HTTPProxy) GetOriginName added in v1.0.0

func (h *HTTPProxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法

func (*HTTPProxy) GetSpeed added in v1.0.0

func (h *HTTPProxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法

func (*HTTPProxy) GetType added in v1.0.0

func (h *HTTPProxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法

func (*HTTPProxy) IsValid added in v1.0.0

func (h *HTTPProxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法

func (*HTTPProxy) SetCountry added in v1.0.0

func (h *HTTPProxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*HTTPProxy) SetIsValid added in v1.0.0

func (h *HTTPProxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*HTTPProxy) SetName added in v1.0.0

func (h *HTTPProxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法

func (*HTTPProxy) SetSpeed added in v1.0.0

func (h *HTTPProxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*HTTPProxy) ToString added in v1.0.0

func (h *HTTPProxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法,将 http 代理转换为 http 链接

type Hy2Proxy added in v1.0.0

type Hy2Proxy struct {
	Group        string  `json:"group,omitempty"`
	Name         string  `json:"name,omitempty"`
	Server       string  `json:"server,omitempty"`
	Port         int     `json:"port,omitempty"`
	Auth         string  `json:"auth,omitempty"`
	Obfs         string  `json:"obfs,omitempty"`
	ObfsPassword string  `json:"obfs-password,omitempty"`
	SNI          string  `json:"sni,omitempty"`
	Insecure     bool    `json:"insecure,omitempty"`
	PinSHA256    string  `json:"pinSHA256,omitempty"`
	Country      string  `json:"country,omitempty"`
	Speed        float64 `json:"speed,omitempty"`
	IsValidFlag  bool    `json:"is-valid,omitempty"`
	OriginName   string  `json:"-,omitempty"` // 原始名称
}

Hy2Proxy hysteria 2 代理结构体

func (*Hy2Proxy) GetCountry added in v1.0.0

func (p *Hy2Proxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法,返回代理所属国家

func (*Hy2Proxy) GetIdentifier added in v1.0.0

func (p *Hy2Proxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法,返回代理唯一标识

func (*Hy2Proxy) GetName added in v1.0.0

func (p *Hy2Proxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法,返回代理节点名称

func (*Hy2Proxy) GetOriginName added in v1.0.0

func (p *Hy2Proxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*Hy2Proxy) GetSpeed added in v1.0.0

func (p *Hy2Proxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法,返回代理速度

func (*Hy2Proxy) GetType added in v1.0.0

func (p *Hy2Proxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法,返回代理类型

func (*Hy2Proxy) IsValid added in v1.0.0

func (p *Hy2Proxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法,判断代理是否有效

func (*Hy2Proxy) SetCountry added in v1.0.0

func (p *Hy2Proxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*Hy2Proxy) SetIsValid added in v1.0.0

func (p *Hy2Proxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*Hy2Proxy) SetName added in v1.0.0

func (p *Hy2Proxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*Hy2Proxy) SetSpeed added in v1.0.0

func (p *Hy2Proxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*Hy2Proxy) ToString added in v1.0.0

func (p *Hy2Proxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法,将代理信息转换为 hy2 协议链接字符串

type HysteriaProxy added in v1.0.0

type HysteriaProxy struct {
	Group          string   `json:"group,omitempty"`
	Name           string   `json:"name,omitempty"`
	Server         string   `json:"server,omitempty"`
	Port           int      `json:"port,omitempty"`
	Auth           string   `json:"auth,omitempty"`
	SNI            string   `json:"sni,omitempty"`
	Up             string   `json:"upmbps,omitempty"`
	Down           string   `json:"downmbps,omitempty"`
	ALPN           []string `json:"alpn,omitempty"`
	Obfs           string   `json:"obfs,omitempty"`
	ObfsParam      string   `json:"obfsParam,omitempty"`
	UDP            bool     `json:"udp,omitempty"`
	TLS13          bool     `json:"tls13,omitempty"`
	SkipCertVerify bool     `json:"skip-cert-verify,omitempty"`
	Country        string   `json:"country,omitempty"`
	Speed          float64  `json:"speed,omitempty"`
	IsValidFlag    bool     `json:"is-valid,omitempty"`
	OriginName     string   `json:"-,omitempty"` // 原始名称
}

HysteriaProxy hysteria 代理结构体

func (*HysteriaProxy) GetCountry added in v1.0.0

func (p *HysteriaProxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法,返回代理所属国家

func (*HysteriaProxy) GetIdentifier added in v1.0.0

func (p *HysteriaProxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法,返回代理唯一标识

func (*HysteriaProxy) GetName added in v1.0.0

func (p *HysteriaProxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法,返回代理节点名称

func (*HysteriaProxy) GetOriginName added in v1.0.0

func (p *HysteriaProxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*HysteriaProxy) GetSpeed added in v1.0.0

func (p *HysteriaProxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法,返回代理速度

func (*HysteriaProxy) GetType added in v1.0.0

func (p *HysteriaProxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法,返回代理类型

func (*HysteriaProxy) IsValid added in v1.0.0

func (p *HysteriaProxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法,判断代理是否有效

func (*HysteriaProxy) SetCountry added in v1.0.0

func (p *HysteriaProxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*HysteriaProxy) SetIsValid added in v1.0.0

func (p *HysteriaProxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*HysteriaProxy) SetName added in v1.0.0

func (p *HysteriaProxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*HysteriaProxy) SetSpeed added in v1.0.0

func (p *HysteriaProxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*HysteriaProxy) ToString added in v1.0.0

func (p *HysteriaProxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法,将代理信息转换为 hysteria 协议链接字符串

type ParamToString added in v1.0.0

type ParamToString interface {
	ToStringWithParam(param string) string
}

ParamToString 定义带参数的 ToString 接口

type Proxy

type Proxy interface {
	GetType() string
	GetName() string
	SetName(name string)
	GetOriginName() string
	GetCountry() string
	SetCountry(country string)
	GetSpeed() float64
	SetSpeed(speed float64)
	IsValid() bool
	SetIsValid(isValid bool)
	GetIdentifier() string
	ToString() string // 新增输出节点字符串的方法
}

Proxy 定义代理接口

func ParseProxy

func ParseProxy(proxy string) (Proxy, error)

ParseProxy 解析代理链接,根据链接前缀调用不同的解析函数

type ProxyList

type ProxyList []Proxy

func ExplodeClash

func ExplodeClash(clash string) (ProxyList, error)

func (ProxyList) Count

func (pl ProxyList) Count() (int, int, int, int, int, int, int, int, int, int)

Count 统计代理列表中不同类型和有效代理的数量

func (ProxyList) Filter

func (pl ProxyList) Filter(proxyTypes, proxyNotTypes, proxyCountry, proxyNotCountry, proxySpeed string, isOnlyValid bool) ProxyList

Filter 根据代理类型、国家和排除国家筛选代理列表

func (ProxyList) RenameAll

func (pl ProxyList) RenameAll() ProxyList

RenameAll 重命名代理列表中所有代理的名称

func (*ProxyList) UniqAppendProxy

func (pl *ProxyList) UniqAppendProxy(newProxy Proxy)

UniqAppendProxy 向代理列表中唯一添加一个代理

func (*ProxyList) UniqAppendProxys

func (pl *ProxyList) UniqAppendProxys(newProxyList ProxyList)

UniqAppendProxys 向代理列表中唯一添加多个代理

type SSProxy added in v1.0.0

type SSProxy struct {
	Group          string  `json:"group,omitempty"`
	Name           string  `json:"name,omitempty"`
	Server         string  `json:"server,omitempty"`
	Port           int     `json:"port,omitempty"`
	Password       string  `json:"password,omitempty"`
	EncryptMethod  string  `json:"encryptMethod,omitempty"`
	Plugin         string  `json:"plugin,omitempty"`
	PluginOption   string  `json:"pluginOption,omitempty"`
	UDP            bool    `json:"udp,omitempty"`
	TCPFastOpen    bool    `json:"tfo,omitempty"`
	SkipCertVerify bool    `json:"skipCertVerify,omitempty"`
	Country        string  `json:"country,omitempty"`
	Speed          float64 `json:"speed,omitempty"`
	IsValidFlag    bool    `json:"isValidFlag,omitempty"`
	OriginName     string  `json:"-,omitempty"` // 原始名称
}

SSProxy ss 代理结构体

func (*SSProxy) GetCountry added in v1.0.0

func (s *SSProxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法

func (*SSProxy) GetIdentifier added in v1.0.0

func (s *SSProxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法

func (*SSProxy) GetName added in v1.0.0

func (s *SSProxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法

func (*SSProxy) GetOriginName added in v1.0.0

func (s *SSProxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*SSProxy) GetSpeed added in v1.0.0

func (s *SSProxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法

func (*SSProxy) GetType added in v1.0.0

func (s *SSProxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法

func (*SSProxy) IsValid added in v1.0.0

func (s *SSProxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法

func (*SSProxy) SetCountry added in v1.0.0

func (s *SSProxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*SSProxy) SetIsValid added in v1.0.0

func (s *SSProxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*SSProxy) SetName added in v1.0.0

func (s *SSProxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*SSProxy) SetSpeed added in v1.0.0

func (s *SSProxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*SSProxy) ToString added in v1.0.0

func (s *SSProxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法,将 ss 代理转换为 ss 链接

func (*SSProxy) ToStringWithParam added in v1.0.0

func (s *SSProxy) ToStringWithParam(param string) string

实现 ParamProxy 接口的 ToStringWithParam 方法

type SSRProxy added in v1.0.0

type SSRProxy struct {
	Group          string  `json:"group,omitempty"`
	Name           string  `json:"name,omitempty"`
	Server         string  `json:"server,omitempty"`
	Port           int     `json:"port,omitempty"`
	Password       string  `json:"password,omitempty"`
	EncryptMethod  string  `json:"cipher,omitempty"`
	Protocol       string  `json:"protocol,omitempty"`
	ProtocolParam  string  `json:"protocol-param,omitempty"`
	OBFS           string  `json:"obfs,omitempty"`
	OBFSParam      string  `json:"obfs-param,omitempty"`
	UDP            bool    `json:"udp,omitempty"`
	TCPFastOpen    bool    `json:"tfo,omitempty"`
	SkipCertVerify bool    `json:"skip-cert-verify,omitempty"`
	Country        string  `json:"country,omitempty"`
	Speed          float64 `json:"speed,omitempty"`
	IsValidFlag    bool    `json:"is-valid,omitempty"`
	OriginName     string  `json:"-,omitempty"` // 原始名称
}

SSRProxy ssr 代理结构体

func (*SSRProxy) GetCountry added in v1.0.0

func (s *SSRProxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法

func (*SSRProxy) GetIdentifier added in v1.0.0

func (s *SSRProxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法

func (*SSRProxy) GetName added in v1.0.0

func (s *SSRProxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法

func (*SSRProxy) GetOriginName added in v1.0.0

func (s *SSRProxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*SSRProxy) GetSpeed added in v1.0.0

func (s *SSRProxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法

func (*SSRProxy) GetType added in v1.0.0

func (s *SSRProxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法

func (*SSRProxy) IsValid added in v1.0.0

func (s *SSRProxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法

func (*SSRProxy) SetCountry added in v1.0.0

func (s *SSRProxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*SSRProxy) SetIsValid added in v1.0.0

func (s *SSRProxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*SSRProxy) SetName added in v1.0.0

func (s *SSRProxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*SSRProxy) SetSpeed added in v1.0.0

func (s *SSRProxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*SSRProxy) ToString added in v1.0.0

func (s *SSRProxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法,将 SSR 代理转换为 SSR 链接

func (*SSRProxy) ToStringWithParam added in v1.0.0

func (s *SSRProxy) ToStringWithParam(param string) string

实现 ParamProxy 接口的 ToStringWithParam 方法

type SnellProxy added in v1.0.0

type SnellProxy struct {
	Group          string  `json:"group,omitempty"`
	Name           string  `json:"name,omitempty"`
	Server         string  `json:"server,omitempty"`
	Port           int     `json:"port,omitempty"`
	PSK            string  `json:"psk,omitempty"`
	Version        int     `json:"version,omitempty"`
	Obfs           string  `json:"obfs,omitempty"`
	ObfsParam      string  `json:"obfs-param,omitempty"`
	UDP            bool    `json:"udp,omitempty"`
	SkipCertVerify bool    `json:"skip-cert-verify,omitempty"`
	Country        string  `json:"country,omitempty"`
	Speed          float64 `json:"speed,omitempty"`
	IsValidFlag    bool    `json:"is-valid,omitempty"`
	OriginName     string  `json:"-,omitempty"` // 原始名称
}

SnellProxy snell 代理结构体

func (*SnellProxy) GetCountry added in v1.0.0

func (p *SnellProxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法,返回代理所属国家

func (*SnellProxy) GetIdentifier added in v1.0.0

func (p *SnellProxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法,返回代理唯一标识

func (*SnellProxy) GetName added in v1.0.0

func (p *SnellProxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法,返回代理节点名称

func (*SnellProxy) GetOriginName added in v1.0.0

func (p *SnellProxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*SnellProxy) GetSpeed added in v1.0.0

func (p *SnellProxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法,返回代理速度

func (*SnellProxy) GetType added in v1.0.0

func (p *SnellProxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法,返回代理类型

func (*SnellProxy) IsValid added in v1.0.0

func (p *SnellProxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法,判断代理是否有效

func (*SnellProxy) SetCountry added in v1.0.0

func (p *SnellProxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*SnellProxy) SetIsValid added in v1.0.0

func (p *SnellProxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*SnellProxy) SetName added in v1.0.0

func (p *SnellProxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*SnellProxy) SetSpeed added in v1.0.0

func (p *SnellProxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*SnellProxy) ToString added in v1.0.0

func (p *SnellProxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法,将代理信息转换为 snell 协议链接字符串

type Socks5Proxy added in v1.0.0

type Socks5Proxy struct {
	Group          string  `json:"group,omitempty"`
	Name           string  `json:"name,omitempty"`
	Server         string  `json:"server,omitempty"`
	Port           int     `json:"port,omitempty"`
	Username       string  `json:"username,omitempty"`
	Password       string  `json:"password,omitempty"`
	UDP            bool    `json:"udp,omitempty"`
	TCPFastOpen    bool    `json:"tfo,omitempty"`
	SkipCertVerify bool    `json:"skipCertVerify,omitempty"`
	Country        string  `json:"country,omitempty"`
	Speed          float64 `json:"speed,omitempty"`
	IsValidFlag    bool    `json:"isValidFlag,omitempty"`
	OriginName     string  `json:"-,omitempty"` // 原始名称
}

Socks5Proxy socks5 代理结构体

func (*Socks5Proxy) GetCountry added in v1.0.0

func (s *Socks5Proxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法

func (*Socks5Proxy) GetIdentifier added in v1.0.0

func (s *Socks5Proxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法

func (*Socks5Proxy) GetName added in v1.0.0

func (s *Socks5Proxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法

func (*Socks5Proxy) GetOriginName added in v1.0.0

func (s *Socks5Proxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*Socks5Proxy) GetSpeed added in v1.0.0

func (s *Socks5Proxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法

func (*Socks5Proxy) GetType added in v1.0.0

func (s *Socks5Proxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法

func (*Socks5Proxy) IsValid added in v1.0.0

func (s *Socks5Proxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法

func (*Socks5Proxy) SetCountry added in v1.0.0

func (s *Socks5Proxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*Socks5Proxy) SetIsValid added in v1.0.0

func (s *Socks5Proxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*Socks5Proxy) SetName added in v1.0.0

func (s *Socks5Proxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*Socks5Proxy) SetSpeed added in v1.0.0

func (s *Socks5Proxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*Socks5Proxy) ToString added in v1.0.0

func (s *Socks5Proxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法,将 socks5 代理转换为 socks5 链接

type TrojanProxy added in v1.0.0

type TrojanProxy struct {
	Group            string  `json:"group,omitempty"`
	Name             string  `json:"name,omitempty"`
	Server           string  `json:"server,omitempty"`
	Port             int     `json:"port,omitempty"`
	Password         string  `json:"password,omitempty"`
	TransferProtocol string  `json:"network,omitempty"`
	Host             string  `json:"host,omitempty"`
	Path             string  `json:"path,omitempty"`
	TLSSecure        bool    `json:"tls,omitempty"`
	UDP              bool    `json:"udp,omitempty"`
	TCPFastOpen      bool    `json:"tfo,omitempty"`
	SkipCertVerify   bool    `json:"skip-cert-verify,omitempty"`
	TLS13            bool    `json:"tls13,omitempty"`
	Country          string  `json:"country,omitempty"`
	Speed            float64 `json:"speed,omitempty"`
	IsValidFlag      bool    `json:"is-valid,omitempty"`
	OriginName       string  `json:"-,omitempty"` // 原始名称
}

TrojanProxy trojan 代理结构体

func (*TrojanProxy) GetCountry added in v1.0.0

func (t *TrojanProxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法

func (*TrojanProxy) GetIdentifier added in v1.0.0

func (t *TrojanProxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法

func (*TrojanProxy) GetName added in v1.0.0

func (t *TrojanProxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法

func (*TrojanProxy) GetOriginName added in v1.0.0

func (t *TrojanProxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*TrojanProxy) GetSpeed added in v1.0.0

func (t *TrojanProxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法

func (*TrojanProxy) GetType added in v1.0.0

func (t *TrojanProxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法

func (*TrojanProxy) IsValid added in v1.0.0

func (t *TrojanProxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法

func (*TrojanProxy) SetCountry added in v1.0.0

func (t *TrojanProxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*TrojanProxy) SetIsValid added in v1.0.0

func (t *TrojanProxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*TrojanProxy) SetName added in v1.0.0

func (t *TrojanProxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*TrojanProxy) SetSpeed added in v1.0.0

func (t *TrojanProxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*TrojanProxy) ToString added in v1.0.0

func (t *TrojanProxy) ToString() string

ToString 实现 Proxy 接口的 ToString 方法

type VlessProxy added in v1.0.0

type VlessProxy struct {
	Group             string   `json:"group,omitempty"`
	Name              string   `json:"name,omitempty"`
	Server            string   `json:"server,omitempty"`
	Port              int      `json:"port,omitempty"`
	UUID              string   `json:"uuid,omitempty"`
	Flow              string   `json:"flow,omitempty"`
	Transport         string   `json:"transport,omitempty"`
	Security          string   `json:"security,omitempty"`
	SNI               string   `json:"sni,omitempty"`
	ALPN              []string `json:"alpn,omitempty"`
	Path              string   `json:"path,omitempty"`
	Host              string   `json:"host,omitempty"`
	UDP               bool     `json:"udp,omitempty"`
	SkipCertVerify    bool     `json:"skip-cert-verify,omitempty"`
	Country           string   `json:"country,omitempty"`
	Speed             float64  `json:"speed,omitempty"`
	IsValidFlag       bool     `json:"is-valid,omitempty"`
	ClientFingerprint string   `json:"client-fingerprint,omitempty"`
	XUDP              bool     `json:"xudp,omitempty"`
	Encryption        string   `json:"encryption,omitempty"`
	OriginName        string   `json:"-,omitempty"` // 原始名称

	RealityOpts struct {
		PublicKey string `json:"public-key,omitempty"`
		ShortID   string `json:"short-id,omitempty"`
	} `json:"reality-opts,omitempty"`

	WSOpts struct {
		Path    string            `json:"path,omitempty"`
		Headers map[string]string `json:"headers,omitempty"`
	} `json:"ws-opts,omitempty"`

	GRPCOpts struct {
		ServiceName string `json:"serviceName,omitempty"`
	} `json:"grpc-opts,omitempty"`
}

VlessProxy vless 代理结构体

func (*VlessProxy) GetCountry added in v1.0.0

func (p *VlessProxy) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法,返回代理所属国家

func (*VlessProxy) GetIdentifier added in v1.0.0

func (p *VlessProxy) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法,返回代理唯一标识

func (*VlessProxy) GetName added in v1.0.0

func (p *VlessProxy) GetName() string

GetName 实现 Proxy 接口的 GetName 方法,返回代理节点名称

func (*VlessProxy) GetOriginName added in v1.0.0

func (p *VlessProxy) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*VlessProxy) GetSpeed added in v1.0.0

func (p *VlessProxy) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法,返回代理速度

func (*VlessProxy) GetType added in v1.0.0

func (p *VlessProxy) GetType() string

GetType 实现 Proxy 接口的 GetType 方法,返回代理类型

func (*VlessProxy) IsValid added in v1.0.0

func (p *VlessProxy) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法,判断代理是否有效

func (*VlessProxy) SetCountry added in v1.0.0

func (p *VlessProxy) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*VlessProxy) SetIsValid added in v1.0.0

func (p *VlessProxy) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*VlessProxy) SetName added in v1.0.0

func (p *VlessProxy) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*VlessProxy) SetSpeed added in v1.0.0

func (p *VlessProxy) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*VlessProxy) ToString added in v1.0.0

func (p *VlessProxy) ToString() string

type Vmess

type Vmess struct {
	Group            string  `json:"group,omitempty"`
	Name             string  `json:"name,omitempty"`
	Server           string  `json:"server,omitempty"`
	Port             int     `json:"port,omitempty"`
	UUID             string  `json:"uuid,omitempty"`
	AlterID          int     `json:"alterId,omitempty"`
	EncryptMethod    string  `json:"encryptMethod,omitempty"`
	TransferProtocol string  `json:"transferProtocol,omitempty"`
	Edge             string  `json:"edge,omitempty"`
	ServerName       string  `json:"serverName,omitempty"`
	Host             string  `json:"host,omitempty"`
	Path             string  `json:"path,omitempty"`
	QUICSecure       string  `json:"quicSecure,omitempty"`
	QUICSecret       string  `json:"quicSecret,omitempty"`
	FakeType         string  `json:"fakeType,omitempty"`
	TLSSecure        bool    `json:"tlsSecure,omitempty"`
	UDP              bool    `json:"udp,omitempty"`
	TCPFastOpen      bool    `json:"tfo,omitempty"`
	SkipCertVerify   bool    `json:"skipCertVerify,omitempty"`
	TLS13            bool    `json:"tls13,omitempty"`
	Country          string  `json:"country,omitempty"`
	Speed            float64 `json:"speed,omitempty"`
	IsValidFlag      bool    `json:"isValidFlag,omitempty"`
	OriginName       string  `json:"-,omitempty"` // 原始名称
}

Vmess 结构体实现 Proxy 接口

func (*Vmess) GetCountry added in v1.0.0

func (v *Vmess) GetCountry() string

GetCountry 实现 Proxy 接口的 GetCountry 方法

func (*Vmess) GetIdentifier added in v1.0.0

func (v *Vmess) GetIdentifier() string

GetIdentifier 实现 Proxy 接口的 GetIdentifier 方法

func (*Vmess) GetName added in v1.0.0

func (v *Vmess) GetName() string

GetName 实现 Proxy 接口的 GetName 方法

func (*Vmess) GetOriginName added in v1.0.0

func (v *Vmess) GetOriginName() string

GetOriginName 实现 Proxy 接口的 GetOriginName 方法,返回代理原始名称

func (*Vmess) GetSpeed added in v1.0.0

func (v *Vmess) GetSpeed() float64

GetSpeed 实现 Proxy 接口的 GetSpeed 方法

func (*Vmess) GetType added in v1.0.0

func (v *Vmess) GetType() string

GetType 实现 Proxy 接口的 GetType 方法

func (*Vmess) IsValid added in v1.0.0

func (v *Vmess) IsValid() bool

IsValid 实现 Proxy 接口的 IsValid 方法

func (*Vmess) SetCountry added in v1.0.0

func (v *Vmess) SetCountry(country string)

SetCountry 实现 Proxy 接口的 SetCountry 方法

func (*Vmess) SetIsValid added in v1.0.0

func (v *Vmess) SetIsValid(isValid bool)

SetIsValid 实现 Proxy 接口的 SetIsValid 方法

func (*Vmess) SetName added in v1.0.0

func (v *Vmess) SetName(name string)

SetName 实现 Proxy 接口的 SetName 方法,设置代理节点名称

func (*Vmess) SetSpeed added in v1.0.0

func (v *Vmess) SetSpeed(speed float64)

SetSpeed 实现 Proxy 接口的 SetSpeed 方法

func (*Vmess) ToString added in v1.0.0

func (v *Vmess) ToString() string

ToString 实现 Proxy 接口的 ToString 方法

Jump to

Keyboard shortcuts

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