mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
Improve(proxy/ss): allow explicit none cipher mode (#312)
This commit is contained in:
+4
-2
@@ -130,11 +130,13 @@ func parseShadowsocks(u *url.URL) (proxy.Proxy, error) {
|
|||||||
obfsMode, obfsHost string
|
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()
|
method = u.User.Username()
|
||||||
password = pass
|
password = pass
|
||||||
} else {
|
} else {
|
||||||
data, _ := base64.RawURLEncoding.DecodeString(u.User.String())
|
data, _ := base64.RawURLEncoding.DecodeString(ss)
|
||||||
userInfo := strings.SplitN(string(data), ":", 2)
|
userInfo := strings.SplitN(string(data), ":", 2)
|
||||||
if len(userInfo) == 2 {
|
if len(userInfo) == 2 {
|
||||||
method = userInfo[0]
|
method = userInfo[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user