Skip to content

Commit

Permalink
Improve(proxy/ss): allow explicit none cipher mode
Browse files Browse the repository at this point in the history
  • Loading branch information
xjasonlyu committed Oct 25, 2023
1 parent 2d80a4b commit 2675915
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engine/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ func parseShadowsocks(u *url.URL) (proxy.Proxy, error) {
obfsMode, obfsHost string
)

if pass, set := u.User.Password(); set {
if ss := u.User.String(); ss == "" {
method = "dummy" // none cipher mode
} else if pass, set := u.User.Password(); set {
method = u.User.Username()
password = pass
} else {
data, _ := base64.RawURLEncoding.DecodeString(u.User.String())
data, _ := base64.RawURLEncoding.DecodeString(ss)
userInfo := strings.SplitN(string(data), ":", 2)
if len(userInfo) == 2 {
method = userInfo[0]
Expand Down

0 comments on commit 2675915

Please sign in to comment.