mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-06-17 20:53:18 +08:00
Unify parts of the model with MetaCubeX.
This commit is contained in:
@ -1,16 +1,18 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/anytls.go
|
||||
type Anytls struct {
|
||||
Server string `yaml:"server"`
|
||||
Port int `yaml:"port"`
|
||||
Password string `yaml:"password,omitempty"`
|
||||
Alpn []string `yaml:"alpn,omitempty"`
|
||||
Sni string `yaml:"sni,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"`
|
||||
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"`
|
||||
}
|
||||
|
@ -1,29 +1,29 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/hysteria.go
|
||||
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"`
|
||||
Up string `yaml:"up"`
|
||||
UpSpeed int `yaml:"up-speed,omitempty"`
|
||||
Down string `yaml:"down"`
|
||||
DownSpeed int `yaml:"down-speed,omitempty"`
|
||||
Auth string `yaml:"auth,omitempty"`
|
||||
AuthStringOLD string `yaml:"auth_str,omitempty"`
|
||||
AuthString string `yaml:"auth-str,omitempty"`
|
||||
Obfs string `yaml:"obfs,omitempty"`
|
||||
SNI string `yaml:"sni,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"`
|
||||
AllowInsecure bool `yaml:"allow-insecure,omitempty"`
|
||||
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"`
|
||||
}
|
||||
|
@ -1,22 +1,29 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/hysteria2.go
|
||||
type Hysteria2 struct {
|
||||
Server string `yaml:"server"`
|
||||
Port int `yaml:"port"`
|
||||
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"`
|
||||
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"`
|
||||
ObfsParam string `yaml:"obfs-param,omitempty"`
|
||||
Sni string `yaml:"sni,omitempty"`
|
||||
TLS bool `yaml:"tls,omitempty"`
|
||||
Network string `yaml:"network,omitempty"`
|
||||
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"`
|
||||
}
|
||||
|
@ -42,6 +42,11 @@ type WireGuardPeerOption struct {
|
||||
AllowedIPs []string `yaml:"allowed-ips,omitempty"`
|
||||
}
|
||||
|
||||
type ECHOptions struct {
|
||||
Enable bool `yaml:"enable,omitempty" obfs:"enable,omitempty"`
|
||||
Config string `yaml:"config,omitempty" obfs:"config,omitempty"`
|
||||
}
|
||||
|
||||
type Proxy struct {
|
||||
Type string
|
||||
Name string
|
||||
|
@ -1,5 +1,6 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/shadowsocks.go
|
||||
type ShadowSocks struct {
|
||||
Server string `yaml:"server"`
|
||||
Port int `yaml:"port"`
|
||||
|
@ -1,5 +1,6 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/shadowsocksr.go
|
||||
type ShadowSocksR struct {
|
||||
Server string `yaml:"server"`
|
||||
Port int `yaml:"port"`
|
||||
|
@ -1,8 +1,13 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/socks5.go
|
||||
type Socks struct {
|
||||
Server string `yaml:"server,omitempty"`
|
||||
Port int `yaml:"port,omitempty"`
|
||||
Username string `yaml:"username,omitempty"`
|
||||
Password string `yaml:"password,omitempty"`
|
||||
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"`
|
||||
}
|
||||
|
@ -1,18 +1,26 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/trojan.go
|
||||
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"`
|
||||
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"`
|
||||
TLS bool `yaml:"tls,omitempty"`
|
||||
}
|
||||
|
||||
type TrojanSSOption struct {
|
||||
Enabled bool `yaml:"enabled,omitempty"`
|
||||
Method string `yaml:"method,omitempty"`
|
||||
Password string `yaml:"password,omitempty"`
|
||||
}
|
||||
|
@ -1,17 +1,19 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/vless.go
|
||||
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"`
|
||||
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"`
|
||||
@ -23,7 +25,4 @@ type Vless struct {
|
||||
Fingerprint string `yaml:"fingerprint,omitempty"`
|
||||
ServerName string `yaml:"servername,omitempty"`
|
||||
ClientFingerprint string `yaml:"client-fingerprint,omitempty"`
|
||||
Sni string `yaml:"sni,omitempty"`
|
||||
AllowInsecure bool `yaml:"allow-insecure,omitempty"`
|
||||
Servername string `yaml:"servername,omitempty"`
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package proxy
|
||||
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/vmess.go
|
||||
type Vmess struct {
|
||||
Server string `yaml:"server"`
|
||||
Port int `yaml:"port"`
|
||||
@ -9,10 +10,11 @@ type Vmess struct {
|
||||
UDP bool `yaml:"udp,omitempty"`
|
||||
Network string `yaml:"network,omitempty"`
|
||||
TLS bool `yaml:"tls,omitempty"`
|
||||
Alpn []string `yaml:"alpn,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"`
|
||||
@ -24,5 +26,4 @@ type Vmess struct {
|
||||
GlobalPadding bool `yaml:"global-padding,omitempty"`
|
||||
AuthenticatedLength bool `yaml:"authenticated-length,omitempty"`
|
||||
ClientFingerprint string `yaml:"client-fingerprint,omitempty"`
|
||||
Servername string `yaml:"servername,omitempty"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user