Skip to content

Commit

Permalink
fix: 修复读取配置错误
Browse files Browse the repository at this point in the history
  • Loading branch information
twbworld committed Sep 24, 2024
1 parent abe1ae1 commit dcbc23b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]: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://[email protected]:443?encryption=none&headerType=none&sni=x.x.x.x&fp=chrome&type=ws#外网信息复杂_理智分辨真假_x.x.x.x_443
trojan://[email protected]: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://[email protected]: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://[email protected]: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://[email protected]: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: `<a href="/404.html">`},
}

Expand Down
12 changes: 6 additions & 6 deletions model/config/child.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
}

Expand Down

0 comments on commit dcbc23b

Please sign in to comment.