mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-31 15:19:45 +07:00
feat: add sniffing suite and dial_mode option (#16)
This commit is contained in:
24
common/consts/control.go
Normal file
24
common/consts/control.go
Normal 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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user