proxy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ClashToString

func ClashToString(proxyList ProxyList) string

func ProxieToClash

func ProxieToClash(node Proxy) map[string]any

Types

type PluginOpts

type PluginOpts struct {
	Mode           string `json:"mode"`
	Host           string `json:"host,omitempty"`
	Tls            bool   `json:"tls,omitempty"`
	Path           string `json:"path,omitempty"`
	Mux            bool   `json:"mux,omitempty"`
	SkipCertVerify bool   `json:"skip-cert-verify,omitempty"`
}

ss的plugin-opts部分

type Proxy

type Proxy struct {
	Country string `json:"country,omitempty"`  // 自定义
	Speed   string `json:"speed,omitempty"`    // 自定义
	IsAlive bool   `json:"is-alive,omitempty"` // 自定义

	Type   string `json:"type,omitempty"`
	Group  string `json:"group,omitempty"`  // vmess,ssr,ss,socks5,http,trojan,snell
	Name   string `json:"name,omitempty"`   // vmess[ps],ssr,ss,socks5,http,trojan,snell
	Server string `json:"server,omitempty"` // vmess[add],ssr,ss,socks5,http,trojan,snell
	Port   int    `json:"prot,omitempty"`   // vmess,ssr,ss,socks5,http,trojan,snell

	Username         string      `json:"user-name,omitempty"`      // *socks5,*http
	Password         string      `json:"password,omitempty"`       // *vmess,*ssr,*ss,*socks5,*http,*trojan,*snell: proxy["psk"]
	EncryptMethod    string      `json:"cipher,omitempty"`         // *vmess[默认auto],*ssr[默认dummy],*ss
	Plugin           string      `json:"plugin,omitempty"`         // *ss
	PluginOption     *PluginOpts `json:"plugin-opts,omitempty"`    // *ss
	Protocol         string      `json:"protocol,omitempty"`       // *ssr
	ProtocolParam    string      `json:"protocol-param,omitempty"` // *ssr
	OBFS             string      `json:"obfs,omitempty"`           // *ssr,snell: proxy["obfs-opts"]["mode"]
	OBFSParam        string      `json:"obfs-param,omitempty"`     // *ssr
	UUID             string      `json:"uuid,omitempty"`           // *vmess[id]
	AlterID          int         `json:"alterId,omitempty"`        // *vmess
	TransferProtocol string      `json:"network,omitempty"`        // *vmess[net=tcp:置空],*trojan[net=tcp:置空]
	FakeType         string      `json:"fake-type,omitempty"`      // vmess[type]
	TLSSecure        bool        `json:"tls,omitempty"`            // *vmess[tls],*http,trojan

	// *snell: proxy["obfs-opts"]["host"]
	// *trojan: proxy["sni"]
	// *trojan[net=ws]: proxy["ws-opts"]["headers"]["Host"]
	// *vmess[net=ws]: proxy["ws-opts"]["Host"]
	// *vmess[net=http]: proxy["http-opts"]["headers"]["Host"]
	// *vmess[net=h2]: proxy["h2-opts"]["host"]
	// *vmess[net=grpc]: proxy["servername"]
	Host string `json:"Host,omitempty"`

	// *trojan/vmess[net=ws]: proxy["ws-opts"]["path"]
	// *vmess[net=http]: proxy["http-opts"]["path"]
	// *vmess[net=h2]: proxy["h2-opts"]["path"]
	// *trojan/vmess[net=grpc]: proxy["grpc-opts"]["grpc-service-name"]
	Path string `json:"path,omitempty"`

	// *vmess[net=ws]: proxy["ws-opts"]["Edge"]
	// *vmess[net=http]: proxy["http-opts"]["headers"]["Edge"]
	Edge string `json:"Edge,omitempty"`

	QUICSecure string `json:"QUICSecure,omitempty"` // vmess[net=quic]
	QUICSecret string `json:"QUICSecret,omitempty"` // vmess[net=quic]

	UDP            bool `json:"udp,omitempty"`              // *vmess,*ssr,*ss,*socks5,*trojan,*snell
	TCPFastOpen    bool `json:"tfo,omitempty"`              // vmess,ssr,ss,socks5,http,trojan,snell
	SkipCertVerify bool `json:"skip-cert-verify,omitempty"` // *vmess,ssr,ss,*socks5,*http,*trojan,snell
	TLS13          bool `json:"tls13,omitempty"`            // vmess,ss,http,trojan

	SnellVersion any    `json:"version,omitempty"`    // *snell
	ServerName   string `json:"servername,omitempty"` // *vmess
}

func ParseProxy

func ParseProxy(proxy string) (Proxy, error)

func (Proxy) Identifier

func (proxy Proxy) Identifier() string

func (Proxy) IsEmpty

func (proxy Proxy) IsEmpty() bool

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)

func (ProxyList) Filter

func (pl ProxyList) Filter(proxyTypes string, proxyCountry string, proxyNotCountry string) ProxyList

func (ProxyList) RenameAll

func (pl ProxyList) RenameAll() ProxyList

func (*ProxyList) UniqAppendProxy

func (pl *ProxyList) UniqAppendProxy(newProxy Proxy)

func (*ProxyList) UniqAppendProxys

func (pl *ProxyList) UniqAppendProxys(newProxyList ProxyList)

type Vmess

type Vmess struct {
	Add  string `json:"add"`
	Aid  any    `json:"aid"`
	Host string `json:"host"`
	ID   string `json:"id"`
	Net  string `json:"net"`
	Path string `json:"path"`
	Port any    `json:"port"`
	PS   string `json:"ps"`
	TLS  string `json:"tls"`
	Type string `json:"type"`
	Sni  string `json:"sni"`
	V    any    `json:"v"`
}

Jump to

Keyboard shortcuts

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