From c90b35111bff127db82cfdb750a2b9c3f58ae63d Mon Sep 17 00:00:00 2001 From: lilendian0x00 Date: Mon, 25 Sep 2023 22:13:02 +0100 Subject: [PATCH] Fixed and optimized parsing shadowsocks --- xray/shadowsocks.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xray/shadowsocks.go b/xray/shadowsocks.go index bab766c..2ed9502 100644 --- a/xray/shadowsocks.go +++ b/xray/shadowsocks.go @@ -35,14 +35,14 @@ func (s *Shadowsocks) Parse(configLink string) error { return errors.New("Invalid config link ") } - link := "ss://" + string(decoded) + "@" + secondPart[1] - uri, err = url.Parse(link) - if err != nil { - return err - } - - s.Encryption = uri.User.Username() // Encryption Type - s.Password, _ = uri.User.Password() // Encryption Password + //link := "ss://" + string(decoded) + "@" + secondPart[1] + //uri, err := url.Parse(link) + //if err != nil { + // return err + //} + creds := strings.SplitN(string(decoded), ":", 2) + s.Encryption = creds[0] // Encryption Type + s.Password = creds[1] // Encryption Password //hostPortRemark := strings.SplitN(secondPart[1], ":", 2)