TUN inbound: Add desc config for Windows ("Wintun" by default) (#6486)

https://github.com/XTLS/Xray-docs-next/pull/872#issuecomment-4936055488
This commit is contained in:
Jasper344612
2026-07-17 22:21:33 +00:00
committed by GitHub
parent e78d8ef184
commit 1d8eb81d70
5 changed files with 29 additions and 9 deletions
+5
View File
@@ -13,6 +13,7 @@ import (
type TunConfig struct {
Name string `json:"name"`
Desc string `json:"desc"`
MTU uint32 `json:"mtu"`
Gateway []string `json:"gateway"`
DNS []string `json:"dns"`
@@ -24,6 +25,7 @@ type TunConfig struct {
func (v *TunConfig) Build() (proto.Message, error) {
config := &tun.Config{
Name: v.Name,
Desc: v.Desc,
MTU: v.MTU,
Gateway: v.Gateway,
DNS: v.DNS,
@@ -44,6 +46,9 @@ func (v *TunConfig) Build() (proto.Message, error) {
}
config.Name = name
}
if config.Desc == "" {
config.Desc = "Wintun"
}
if config.MTU == 0 {
config.MTU = 1500
}