diff --git a/main_test.go b/main_test.go index 9f014bf..9f77597 100644 --- a/main_test.go +++ b/main_test.go @@ -46,9 +46,9 @@ func TestMain(t *testing.T) { contentType string }{ {method: http.MethodGet, url: "http://clash.domain.com/test.html", getRes: `proxies: [{"name":"外网信息复杂_理智分辨真假_www.domain.com_443","type":"vless"`}, - {method: http.MethodGet, url: "http://domain.com/test.html", getRes: utils.Base64Encode(`vless://xxxx@www.domain.com:443?encryption=none&headerType=none&sni=www.domain.com&fp=chrome&type=tcp&alpn=h2,http/1.1&flow=xtls-rprx-vision&security=tls#外网信息复杂_理智分辨真假_www.domain.com_443 -vless://xxxx@x.x.x.x:443?encryption=none&headerType=none&sni=x.x.x.x&fp=chrome&type=ws#外网信息复杂_理智分辨真假_x.x.x.x_443 -trojan://password@www.domain.com:443?encryption=none&headerType=none&sni=www.domain.com&fp=chrome&type=ws&alpn=h2,http/1.1&security=tls#外网信息复杂_理智分辨真假_www.domain.com_443`)}, + {method: http.MethodGet, url: "http://domain.com/test.html", getRes: utils.Base64Encode(`vless://xxxx@www.domain.com:443?encryption=none&headerType=none&sni=www.domain.com&fp=chrome&type=tcp&flow=xtls-rprx-vision&pbk=xxxx&sid=&security=reality#外网信息复杂_理智分辨真假_www.domain.com_443 +vless://xxxx@x.x.x.x:443?encryption=none&headerType=none&sni=www.domain.com&fp=chrome&type=ws&alpn=h2,http/1.1&host=www.domain.com&path=/vless-ws&security=tls#外网信息复杂_理智分辨真假_x.x.x.x_443 +trojan://password@www.domain.com:443?encryption=none&headerType=none&sni=www.domain.com&fp=chrome&type=ws&alpn=h2,http/1.1&host=www.domain.com&path=/trojan-go-ws/&security=tls#外网信息复杂_理智分辨真假_www.domain.com_443`)}, {method: http.MethodGet, url: "http://domain.com/aa.html", status: http.StatusMovedPermanently, getRes: ``}, } diff --git a/model/config/child.go b/model/config/child.go index 25a3702..8d4ac15 100644 --- a/model/config/child.go +++ b/model/config/child.go @@ -3,8 +3,8 @@ package config import "fmt" type RealityOpts struct { - PublicKey string `json:"public-key" mapstructure:"public_key" yaml:"public_key"` - ShortId string `json:"short-id" mapstructure:"short_id" yaml:"short_id"` + PublicKey string `json:"public-key" mapstructure:"public-key" yaml:"public-key"` + ShortId string `json:"short-id" mapstructure:"short-id" yaml:"short-id"` } type WsOpts struct { Path string `json:"path" mapstructure:"path" yaml:"path"` @@ -20,15 +20,15 @@ type Proxy struct { Port string `json:"port" mapstructure:"port" yaml:"port"` Tls bool `json:"tls" mapstructure:"tls" yaml:"tls"` Udp bool `json:"udp" mapstructure:"udp" yaml:"udp"` - SkipCertVerify bool `json:"skip-cert-verify" mapstructure:"skip_cert_verify" yaml:"skip_cert_verify"` - ClientFingerprint string `json:"client-fingerprint" mapstructure:"client_fingerprint" yaml:"client_fingerprint"` + SkipCertVerify bool `json:"skip-cert-verify" mapstructure:"skip-cert-verify" yaml:"skip-cert-verify"` + ClientFingerprint string `json:"client-fingerprint" mapstructure:"client-fingerprint" yaml:"client-fingerprint"` Alpn []string `json:"alpn" mapstructure:"alpn" yaml:"alpn"` Sni string `json:"sni" mapstructure:"sni" yaml:"sni"` Uuid string `json:"uuid" mapstructure:"uuid" yaml:"uuid"` Flow string `json:"flow" mapstructure:"flow" yaml:"flow"` Network string `json:"network" mapstructure:"network" yaml:"network"` - RealityOpts RealityOpts `json:"reality-opts" mapstructure:"reality_opts" yaml:"reality_opts"` - WsOpts WsOpts `json:"ws-opts" mapstructure:"ws_opts" yaml:"ws_opts"` + RealityOpts RealityOpts `json:"reality-opts" mapstructure:"reality-opts" yaml:"reality-opts"` + WsOpts WsOpts `json:"ws-opts" mapstructure:"ws-opts" yaml:"ws-opts"` Root bool `json:"root,omitempty" mapstructure:"root" yaml:"root"` }