Skip to content

Commit

Permalink
Fixed and optimized parsing shadowsocks
Browse files Browse the repository at this point in the history
  • Loading branch information
lilendian0x00 committed Sep 25, 2023
1 parent 75e166e commit c90b351
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions xray/shadowsocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c90b351

Please sign in to comment.