proxy

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 3 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                     IntOrString `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                IntOrString `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           IntOrString `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 IntOrString added in v1.1.1

type IntOrString int

func (*IntOrString) UnmarshalYAML added in v1.1.1

func (i *IntOrString) UnmarshalYAML(value *yaml.Node) error

type Proxy

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

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              IntOrString    `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          IntOrString `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           IntOrString `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              IntOrString    `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 Tuic added in v1.1.1

type Tuic struct {
	Server                string   `proxy:"server"`
	Port                  int      `proxy:"port"`
	Token                 string   `proxy:"token,omitempty"`
	UUID                  string   `proxy:"uuid,omitempty"`
	Password              string   `proxy:"password,omitempty"`
	Ip                    string   `proxy:"ip,omitempty"`
	HeartbeatInterval     int      `proxy:"heartbeat-interval,omitempty"`
	ALPN                  []string `proxy:"alpn,omitempty"`
	ReduceRtt             bool     `proxy:"reduce-rtt,omitempty"`
	RequestTimeout        int      `proxy:"request-timeout,omitempty"`
	UdpRelayMode          string   `proxy:"udp-relay-mode,omitempty"`
	CongestionController  string   `proxy:"congestion-controller,omitempty"`
	DisableSni            bool     `proxy:"disable-sni,omitempty"`
	MaxUdpRelayPacketSize int      `proxy:"max-udp-relay-packet-size,omitempty"`

	FastOpen             bool       `proxy:"fast-open,omitempty"`
	MaxOpenStreams       int        `proxy:"max-open-streams,omitempty"`
	CWND                 int        `proxy:"cwnd,omitempty"`
	SkipCertVerify       bool       `proxy:"skip-cert-verify,omitempty"`
	Fingerprint          string     `proxy:"fingerprint,omitempty"`
	Certificate          string     `proxy:"certificate,omitempty"`
	PrivateKey           string     `proxy:"private-key,omitempty"`
	ReceiveWindowConn    int        `proxy:"recv-window-conn,omitempty"`
	ReceiveWindow        int        `proxy:"recv-window,omitempty"`
	DisableMTUDiscovery  bool       `proxy:"disable-mtu-discovery,omitempty"`
	MaxDatagramFrameSize int        `proxy:"max-datagram-frame-size,omitempty"`
	SNI                  string     `proxy:"sni,omitempty"`
	ECHOpts              ECHOptions `proxy:"ech-opts,omitempty"`

	UDPOverStream        bool `proxy:"udp-over-stream,omitempty"`
	UDPOverStreamVersion int  `proxy:"udp-over-stream-version,omitempty"`
}

type Vless

type Vless struct {
	Server            string            `yaml:"server"`
	Port              IntOrString       `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                IntOrString    `yaml:"port"`
	UUID                string         `yaml:"uuid"`
	AlterID             IntOrString    `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