feat: add sniffing suite and dial_mode option (#16)

This commit is contained in:
mzz
2023-02-15 01:53:53 +08:00
committed by GitHub
parent 2a586e6341
commit ebdbf9a4a7
25 changed files with 1561 additions and 19 deletions

24
common/consts/control.go Normal file
View File

@ -0,0 +1,24 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (c) since 2023, v2rayA Organization <team@v2raya.org>
*/
package consts
import "fmt"
type DialMode string
const (
DialMode_Ip DialMode = "ip"
DialMode_Domain DialMode = "domain"
)
func ParseDialMode(mode string) (DialMode, error) {
switch mode {
case "ip", "domain":
return DialMode(mode), nil
default:
return "", fmt.Errorf("unsupported dial mode: %v", mode)
}
}