mirror of
				https://github.com/nadoo/glider.git
				synced 2025-11-04 07:42:38 +08:00 
			
		
		
		
	vmess(security-auto): choose security automaticly rather than using obsolete format
This commit is contained in:
		
							parent
							
								
									1b484cca8f
								
							
						
					
					
						commit
						57c1f3d717
					
				@ -11,6 +11,7 @@ import (
 | 
				
			|||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"math/rand"
 | 
						"math/rand"
 | 
				
			||||||
	"net"
 | 
						"net"
 | 
				
			||||||
 | 
						"runtime"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -95,9 +96,10 @@ func NewClient(uuidStr, security string, alterID int) (*Client, error) {
 | 
				
			|||||||
	case "none":
 | 
						case "none":
 | 
				
			||||||
		c.security = SecurityNone
 | 
							c.security = SecurityNone
 | 
				
			||||||
	case "":
 | 
						case "":
 | 
				
			||||||
		// NOTE: use basic format when no method specified
 | 
							if runtime.GOARCH == "amd64" || runtime.GOARCH == "s390x" || runtime.GOARCH == "arm64" {
 | 
				
			||||||
		c.opt = OptBasicFormat
 | 
								c.security = SecurityAES128GCM
 | 
				
			||||||
		c.security = SecurityNone
 | 
							}
 | 
				
			||||||
 | 
							c.security = SecurityChacha20Poly1305
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return nil, errors.New("unknown security type: " + security)
 | 
							return nil, errors.New("unknown security type: " + security)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user