From 539f604e3705d9309077db19f94a03bc97280a4c Mon Sep 17 00:00:00 2001 From: mzz Date: Thu, 3 Dec 2020 17:12:16 +0800 Subject: [PATCH] vmess(security-auto): choose security automaticly rather than using obsolete format (#200) --- proxy/vmess/client.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxy/vmess/client.go b/proxy/vmess/client.go index b6988e5..115b6e2 100644 --- a/proxy/vmess/client.go +++ b/proxy/vmess/client.go @@ -11,6 +11,7 @@ import ( "io" "math/rand" "net" + "runtime" "strings" "time" @@ -95,9 +96,10 @@ func NewClient(uuidStr, security string, alterID int) (*Client, error) { case "none": c.security = SecurityNone case "": - // NOTE: use basic format when no method specified - c.opt = OptBasicFormat - c.security = SecurityNone + if runtime.GOARCH == "amd64" || runtime.GOARCH == "s390x" || runtime.GOARCH == "arm64" { + c.security = SecurityAES128GCM + } + c.security = SecurityChacha20Poly1305 default: return nil, errors.New("unknown security type: " + security) }