From d3ab9196553cc1d24bd004126bcd5afec1042e9c Mon Sep 17 00:00:00 2001 From: moexiami Date: Fri, 29 Mar 2024 19:09:38 +0759 Subject: [PATCH] fix: correct type for vmess.ws-opts.path in ConvertsV2Ray It should be a string for the following reasons: 1. During conversion, it is conditionally assigned with `wsOpts["path"] = path.(string)` 2. After conversion, it is decoded into `WSOptions.Path` in `adapter/outbound/vmess.go` which requires a string. --- common/convert/converter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/convert/converter.go b/common/convert/converter.go index 809aa94f..c40c01e9 100644 --- a/common/convert/converter.go +++ b/common/convert/converter.go @@ -333,7 +333,7 @@ func ConvertsV2Ray(buf []byte) ([]map[string]any, error) { case "ws": headers := make(map[string]any) wsOpts := make(map[string]any) - wsOpts["path"] = []string{"/"} + wsOpts["path"] = "/" if host, ok := values["host"]; ok && host != "" { headers["Host"] = host.(string) }