增加防探测功能,增加流量加密功能
This commit is contained in:
11
cmd/root.go
11
cmd/root.go
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
"shadowTLS/shadow"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -15,6 +16,8 @@ var (
|
||||
|
||||
func init() {
|
||||
rootCmd.CompletionOptions.DisableDefaultCmd = true
|
||||
rootCmd.PersistentFlags().StringVarP(&shadow.HandshakePassword, "password", "p", "", "Password for probe resist.Probe resist will be disabled if password is empty.")
|
||||
rootCmd.PersistentFlags().StringVarP(&shadow.Key, "key", "k", "", "Encryption key for AES-CBC.Encryption will be enabled if key is set.Length of key must be 16,24 or 32.")
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
@ -23,3 +26,11 @@ func Execute() {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func verifyAndParseEncryptionKey() bool {
|
||||
if shadow.Key != "" && len(shadow.Key) != 16 && len(shadow.Key) != 24 && len(shadow.Key) != 32 {
|
||||
return false
|
||||
}
|
||||
shadow.EncryptKey = []byte(shadow.Key)
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user