proxy

package
v0.0.13-beta.5 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anytls

type Anytls struct {
	Server                   string     `yaml:"server"`
	Port                     int        `yaml:"port"`
	Password                 string     `yaml:"password"`
	ALPN                     []string   `yaml:"alpn,omitempty"`
	SNI                      string     `yaml:"sni,omitempty"`
	ECHOpts                  ECHOptions `yaml:"ech-opts,omitempty"`
	ClientFingerprint        string     `yaml:"client-fingerprint,omitempty"`
	SkipCertVerify           bool       `yaml:"skip-cert-verify,omitempty"`
	Fingerprint              string     `yaml:"fingerprint,omitempty"`
	UDP                      bool       `yaml:"udp,omitempty"`
	IdleSessionCheckInterval int        `yaml:"idle-session-check-interval,omitempty"`
	IdleSessionTimeout       int        `yaml:"idle-session-timeout,omitempty"`
	MinIdleSession           int        `yaml:"min-idle-session,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/anytls.go

type ECHOptions

type ECHOptions struct {
	Enable bool   `yaml:"enable,omitempty" obfs:"enable,omitempty"`
	Config string `yaml:"config,omitempty" obfs:"config,omitempty"`
}

type GrpcOptions

type GrpcOptions struct {
	GrpcServiceName string `yaml:"grpc-service-name,omitempty"`
}

type HTTP2Options

type HTTP2Options struct {
	Host []string `yaml:"host,omitempty"`
	Path string   `yaml:"path,omitempty"`
}

type HTTPOptions

type HTTPOptions struct {
	Method  string              `yaml:"method,omitempty"`
	Path    []string            `yaml:"path,omitempty"`
	Headers map[string][]string `yaml:"headers,omitempty"`
}

type Hysteria

type Hysteria struct {
	Server              string     `yaml:"server"`
	Port                int        `yaml:"port,omitempty"`
	Ports               string     `yaml:"ports,omitempty"`
	Protocol            string     `yaml:"protocol,omitempty"`
	ObfsProtocol        string     `yaml:"obfs-protocol,omitempty"` // compatible with Stash
	Up                  string     `yaml:"up"`
	UpSpeed             int        `yaml:"up-speed,omitempty"` // compatible with Stash
	Down                string     `yaml:"down"`
	DownSpeed           int        `yaml:"down-speed,omitempty"` // compatible with Stash
	Auth                string     `yaml:"auth,omitempty"`
	AuthString          string     `yaml:"auth-str,omitempty"`
	Obfs                string     `yaml:"obfs,omitempty"`
	SNI                 string     `yaml:"sni,omitempty"`
	ECHOpts             ECHOptions `yaml:"ech-opts,omitempty"`
	SkipCertVerify      bool       `yaml:"skip-cert-verify,omitempty"`
	Fingerprint         string     `yaml:"fingerprint,omitempty"`
	ALPN                []string   `yaml:"alpn,omitempty"`
	CustomCA            string     `yaml:"ca,omitempty"`
	CustomCAString      string     `yaml:"ca-str,omitempty"`
	ReceiveWindowConn   int        `yaml:"recv-window-conn,omitempty"`
	ReceiveWindow       int        `yaml:"recv-window,omitempty"`
	DisableMTUDiscovery bool       `yaml:"disable-mtu-discovery,omitempty"`
	FastOpen            bool       `yaml:"fast-open,omitempty"`
	HopInterval         int        `yaml:"hop-interval,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/hysteria.go

type Hysteria2

type Hysteria2 struct {
	Server         string     `yaml:"server"`
	Port           int        `yaml:"port,omitempty"`
	Ports          string     `yaml:"ports,omitempty"`
	HopInterval    int        `yaml:"hop-interval,omitempty"`
	Up             string     `yaml:"up,omitempty"`
	Down           string     `yaml:"down,omitempty"`
	Password       string     `yaml:"password,omitempty"`
	Obfs           string     `yaml:"obfs,omitempty"`
	ObfsPassword   string     `yaml:"obfs-password,omitempty"`
	SNI            string     `yaml:"sni,omitempty"`
	ECHOpts        ECHOptions `yaml:"ech-opts,omitempty"`
	SkipCertVerify bool       `yaml:"skip-cert-verify,omitempty"`
	Fingerprint    string     `yaml:"fingerprint,omitempty"`
	ALPN           []string   `yaml:"alpn,omitempty"`
	CustomCA       string     `yaml:"ca,omitempty"`
	CustomCAString string     `yaml:"ca-str,omitempty"`
	CWND           int        `yaml:"cwnd,omitempty"`
	UdpMTU         int        `yaml:"udp-mtu,omitempty"`

	// quic-go special config
	InitialStreamReceiveWindow     uint64 `yaml:"initial-stream-receive-window,omitempty"`
	MaxStreamReceiveWindow         uint64 `yaml:"max-stream-receive-window,omitempty"`
	InitialConnectionReceiveWindow uint64 `yaml:"initial-connection-receive-window,omitempty"`
	MaxConnectionReceiveWindow     uint64 `yaml:"max-connection-receive-window,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/hysteria2.go

type Proxy

type Proxy struct {
	Type    string
	Name    string
	SubName string `yaml:"-"`
	Anytls
	Hysteria
	Hysteria2
	ShadowSocks
	ShadowSocksR
	Trojan
	Vless
	Vmess
	Socks
}

func (Proxy) MarshalYAML

func (p Proxy) MarshalYAML() (any, error)

func (*Proxy) UnmarshalYAML added in v1.0.0

func (p *Proxy) UnmarshalYAML(node *yaml.Node) error

type RealityOptions

type RealityOptions struct {
	PublicKey string `yaml:"public-key"`
	ShortID   string `yaml:"short-id,omitempty"`
}

type ShadowSocks

type ShadowSocks struct {
	Server            string         `yaml:"server"`
	Port              int            `yaml:"port"`
	Password          string         `yaml:"password"`
	Cipher            string         `yaml:"cipher"`
	UDP               bool           `yaml:"udp,omitempty"`
	Plugin            string         `yaml:"plugin,omitempty"`
	PluginOpts        map[string]any `yaml:"plugin-opts,omitempty"`
	UDPOverTCP        bool           `yaml:"udp-over-tcp,omitempty"`
	UDPOverTCPVersion int            `yaml:"udp-over-tcp-version,omitempty"`
	ClientFingerprint string         `yaml:"client-fingerprint,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/shadowsocks.go

type ShadowSocksR

type ShadowSocksR struct {
	Server        string `yaml:"server"`
	Port          int    `yaml:"port"`
	Password      string `yaml:"password"`
	Cipher        string `yaml:"cipher"`
	Obfs          string `yaml:"obfs"`
	ObfsParam     string `yaml:"obfs-param,omitempty"`
	Protocol      string `yaml:"protocol"`
	ProtocolParam string `yaml:"protocol-param,omitempty"`
	UDP           bool   `yaml:"udp,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/shadowsocksr.go

type SmuxStruct

type SmuxStruct struct {
	Enabled bool `yaml:"enable"`
}

type Socks

type Socks struct {
	Server         string `yaml:"server"`
	Port           int    `yaml:"port"`
	UserName       string `yaml:"username,omitempty"`
	Password       string `yaml:"password,omitempty"`
	TLS            bool   `yaml:"tls,omitempty"`
	UDP            bool   `yaml:"udp,omitempty"`
	SkipCertVerify bool   `yaml:"skip-cert-verify,omitempty"`
	Fingerprint    string `yaml:"fingerprint,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/socks5.go

type Trojan

type Trojan struct {
	Server            string         `yaml:"server"`
	Port              int            `yaml:"port"`
	Password          string         `yaml:"password"`
	ALPN              []string       `yaml:"alpn,omitempty"`
	SNI               string         `yaml:"sni,omitempty"`
	SkipCertVerify    bool           `yaml:"skip-cert-verify,omitempty"`
	Fingerprint       string         `yaml:"fingerprint,omitempty"`
	UDP               bool           `yaml:"udp,omitempty"`
	Network           string         `yaml:"network,omitempty"`
	ECHOpts           ECHOptions     `yaml:"ech-opts,omitempty"`
	RealityOpts       RealityOptions `yaml:"reality-opts,omitempty"`
	GrpcOpts          GrpcOptions    `yaml:"grpc-opts,omitempty"`
	WSOpts            WSOptions      `yaml:"ws-opts,omitempty"`
	SSOpts            TrojanSSOption `yaml:"ss-opts,omitempty"`
	ClientFingerprint string         `yaml:"client-fingerprint,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/trojan.go

type TrojanSSOption

type TrojanSSOption struct {
	Enabled  bool   `yaml:"enabled,omitempty"`
	Method   string `yaml:"method,omitempty"`
	Password string `yaml:"password,omitempty"`
}

type Vless

type Vless struct {
	Server            string            `yaml:"server"`
	Port              int               `yaml:"port"`
	UUID              string            `yaml:"uuid"`
	Flow              string            `yaml:"flow,omitempty"`
	TLS               bool              `yaml:"tls,omitempty"`
	ALPN              []string          `yaml:"alpn,omitempty"`
	UDP               bool              `yaml:"udp,omitempty"`
	PacketAddr        bool              `yaml:"packet-addr,omitempty"`
	XUDP              bool              `yaml:"xudp,omitempty"`
	PacketEncoding    string            `yaml:"packet-encoding,omitempty"`
	Network           string            `yaml:"network,omitempty"`
	ECHOpts           ECHOptions        `yaml:"ech-opts,omitempty"`
	RealityOpts       RealityOptions    `yaml:"reality-opts,omitempty"`
	HTTPOpts          HTTPOptions       `yaml:"http-opts,omitempty"`
	HTTP2Opts         HTTP2Options      `yaml:"h2-opts,omitempty"`
	GrpcOpts          GrpcOptions       `yaml:"grpc-opts,omitempty"`
	WSOpts            WSOptions         `yaml:"ws-opts,omitempty"`
	WSPath            string            `yaml:"ws-path,omitempty"`
	WSHeaders         map[string]string `yaml:"ws-headers,omitempty"`
	SkipCertVerify    bool              `yaml:"skip-cert-verify,omitempty"`
	Fingerprint       string            `yaml:"fingerprint,omitempty"`
	ServerName        string            `yaml:"servername,omitempty"`
	ClientFingerprint string            `yaml:"client-fingerprint,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/vless.go

type Vmess

type Vmess struct {
	Server              string         `yaml:"server"`
	Port                int            `yaml:"port"`
	UUID                string         `yaml:"uuid"`
	AlterID             int            `yaml:"alterId"`
	Cipher              string         `yaml:"cipher"`
	UDP                 bool           `yaml:"udp,omitempty"`
	Network             string         `yaml:"network,omitempty"`
	TLS                 bool           `yaml:"tls,omitempty"`
	ALPN                []string       `yaml:"alpn,omitempty"`
	SkipCertVerify      bool           `yaml:"skip-cert-verify,omitempty"`
	Fingerprint         string         `yaml:"fingerprint,omitempty"`
	ServerName          string         `yaml:"servername,omitempty"`
	ECHOpts             ECHOptions     `yaml:"ech-opts,omitempty"`
	RealityOpts         RealityOptions `yaml:"reality-opts,omitempty"`
	HTTPOpts            HTTPOptions    `yaml:"http-opts,omitempty"`
	HTTP2Opts           HTTP2Options   `yaml:"h2-opts,omitempty"`
	GrpcOpts            GrpcOptions    `yaml:"grpc-opts,omitempty"`
	WSOpts              WSOptions      `yaml:"ws-opts,omitempty"`
	PacketAddr          bool           `yaml:"packet-addr,omitempty"`
	XUDP                bool           `yaml:"xudp,omitempty"`
	PacketEncoding      string         `yaml:"packet-encoding,omitempty"`
	GlobalPadding       bool           `yaml:"global-padding,omitempty"`
	AuthenticatedLength bool           `yaml:"authenticated-length,omitempty"`
	ClientFingerprint   string         `yaml:"client-fingerprint,omitempty"`
}

https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/vmess.go

type WSOptions

type WSOptions struct {
	Path                string            `yaml:"path,omitempty"`
	Headers             map[string]string `yaml:"headers,omitempty"`
	MaxEarlyData        int               `yaml:"max-early-data,omitempty"`
	EarlyDataHeaderName string            `yaml:"early-data-header-name,omitempty"`
}

type WireGuardPeerOption

type WireGuardPeerOption struct {
	Server       string   `yaml:"server"`
	Port         int      `yaml:"port"`
	PublicKey    string   `yaml:"public-key,omitempty"`
	PreSharedKey string   `yaml:"pre-shared-key,omitempty"`
	Reserved     []uint8  `yaml:"reserved,omitempty"`
	AllowedIPs   []string `yaml:"allowed-ips,omitempty"`
}

Jump to

Keyboard shortcuts

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