diff --git a/adapter/parser.go b/adapter/parser.go index 56febe28..3052ab10 100644 --- a/adapter/parser.go +++ b/adapter/parser.go @@ -49,13 +49,7 @@ func ParseProxy(mapping map[string]any) (C.Proxy, error) { } proxy, err = outbound.NewHttp(*httpOption) case "vmess": - vmessOption := &outbound.VmessOption{ - HTTPOpts: outbound.HTTPOptions{ - Method: "GET", - Path: []string{"/"}, - }, - } - + vmessOption := &outbound.VmessOption{} err = decoder.Decode(mapping, vmessOption) if err != nil { break diff --git a/transport/vmess/http.go b/transport/vmess/http.go index 3c66fe6b..94f1fbd3 100644 --- a/transport/vmess/http.go +++ b/transport/vmess/http.go @@ -3,7 +3,6 @@ package vmess import ( "bufio" "bytes" - "errors" "fmt" "net" "net/http" @@ -55,11 +54,11 @@ func (hc *httpConn) Write(b []byte) (int, error) { return hc.Conn.Write(b) } - if len(hc.cfg.Path) == 0 { - return -1, errors.New("path is empty") + path := "/" + if len(hc.cfg.Path) > 0 { + path = hc.cfg.Path[randv2.IntN(len(hc.cfg.Path))] } - path := hc.cfg.Path[randv2.IntN(len(hc.cfg.Path))] host := hc.cfg.Host if header := hc.cfg.Headers["Host"]; len(header) != 0 { host = header[randv2.IntN(len(header))]