mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-06-17 12:43:18 +08:00
Move HTTP, gRPC, Reality, and WebSocket options to proxy.go refactor VmessJson type to use 'any' for flexible types
This commit is contained in:
@ -1,5 +1,32 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
|
type HTTPOptions struct {
|
||||||
|
Method string `yaml:"method,omitempty"`
|
||||||
|
Path []string `yaml:"path,omitempty"`
|
||||||
|
Headers map[string][]string `yaml:"headers,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type HTTP2Options struct {
|
||||||
|
Host []string `yaml:"host,omitempty"`
|
||||||
|
Path string `yaml:"path,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GrpcOptions struct {
|
||||||
|
GrpcServiceName string `yaml:"grpc-service-name,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type RealityOptions struct {
|
||||||
|
PublicKey string `yaml:"public-key"`
|
||||||
|
ShortID string `yaml:"short-id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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 SmuxStruct struct {
|
type SmuxStruct struct {
|
||||||
Enabled bool `yaml:"enable"`
|
Enabled bool `yaml:"enable"`
|
||||||
}
|
}
|
||||||
|
@ -1,48 +1,21 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
type HTTPOptions struct {
|
|
||||||
Method string `yaml:"method,omitempty"`
|
|
||||||
Path []string `yaml:"path,omitempty"`
|
|
||||||
Headers map[string][]string `yaml:"headers,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type HTTP2Options struct {
|
|
||||||
Host []string `yaml:"host,omitempty"`
|
|
||||||
Path string `yaml:"path,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GrpcOptions struct {
|
|
||||||
GrpcServiceName string `yaml:"grpc-service-name,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type RealityOptions struct {
|
|
||||||
PublicKey string `yaml:"public-key"`
|
|
||||||
ShortID string `yaml:"short-id,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
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 VmessJson struct {
|
type VmessJson struct {
|
||||||
V string `json:"v"`
|
V any `json:"v"`
|
||||||
Ps string `json:"ps"`
|
Ps string `json:"ps"`
|
||||||
Add string `json:"add"`
|
Add string `json:"add"`
|
||||||
Port interface{} `json:"port"`
|
Port any `json:"port"`
|
||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
Aid interface{} `json:"aid"`
|
Aid any `json:"aid"`
|
||||||
Scy string `json:"scy"`
|
Scy string `json:"scy"`
|
||||||
Net string `json:"net"`
|
Net string `json:"net"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Tls string `json:"tls"`
|
Tls string `json:"tls"`
|
||||||
Sni string `json:"sni"`
|
Sni string `json:"sni"`
|
||||||
Alpn string `json:"alpn"`
|
Alpn string `json:"alpn"`
|
||||||
Fp string `json:"fp"`
|
Fp string `json:"fp"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Vmess struct {
|
type Vmess struct {
|
||||||
|
Reference in New Issue
Block a user