From f7dc78aabce161362ca34b8f34f9863e7caec0f5 Mon Sep 17 00:00:00 2001 From: Nite07 Date: Sat, 19 Oct 2024 15:39:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parser/vless.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/parser/vless.go b/parser/vless.go index 935896e..c515f2c 100644 --- a/parser/vless.go +++ b/parser/vless.go @@ -104,6 +104,11 @@ func ParseVless(proxy string) (model.Proxy, error) { } if _type == "http" { + result.HTTPOpts = model.HTTPOptions{} + result.HTTPOpts.Headers = map[string][]string{} + + result.HTTPOpts.Path = strings.Split(path, ",") + hosts, err := url.QueryUnescape(host) if err != nil { return model.Proxy{}, &ParseError{ @@ -113,10 +118,9 @@ func ParseVless(proxy string) (model.Proxy, error) { } } result.Network = "http" - result.HTTPOpts = model.HTTPOptions{ - Headers: map[string][]string{"Host": strings.Split(hosts, ",")}, + if hosts != "" { + result.HTTPOpts.Headers["host"] = strings.Split(host, ",") } - } return result, nil