mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-07-01 08:50:01 +00:00
chore(tun): show error on unsupported platform
This commit is contained in:
parent
2e93c12cdc
commit
b287020daa
@ -9,6 +9,8 @@ import (
|
||||
"net"
|
||||
"net/netip"
|
||||
"os"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -684,6 +686,10 @@ func clientTCPRedirect(config tcpRedirectConfig, c client.Client) error {
|
||||
}
|
||||
|
||||
func clientTUN(config tunConfig, c client.Client) error {
|
||||
supportedPlatforms := []string{"linux", "darwin", "windows", "android"}
|
||||
if !slices.Contains(supportedPlatforms, runtime.GOOS) {
|
||||
logger.Error("TUN is not supported on this platform", zap.String("platform", runtime.GOOS))
|
||||
}
|
||||
if config.Name == "" {
|
||||
return configError{Field: "name", Err: errors.New("name is empty")}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user