Skip to content

Commit

Permalink
vmess(security-auto): choose security automaticly rather than using o…
Browse files Browse the repository at this point in the history
…bsolete format (#200)
  • Loading branch information
mzz2017 authored Dec 3, 2020
1 parent 1b484cc commit 539f604
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions proxy/vmess/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io"
"math/rand"
"net"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 539f604

Please sign in to comment.