Feat: support set tun file-descriptor in config file

Co-authored-by: DuFoxit <DuFoxit@users.noreply.github.com>
This commit is contained in:
wwqgtxx
2023-03-15 23:43:58 +08:00
parent 520cc807d6
commit 998d407d44
6 changed files with 12 additions and 1 deletions

View File

@ -80,6 +80,7 @@ type tunSchema struct {
ExcludePackage *[]string `yaml:"exclude-package" json:"exclude-package,omitempty"`
EndpointIndependentNat *bool `yaml:"endpoint-independent-nat" json:"endpoint-independent-nat,omitempty"`
UDPTimeout *int64 `yaml:"udp-timeout" json:"udp-timeout,omitempty"`
FileDescriptor *int `yaml:"file-descriptor" json:"file-descriptor"`
}
type tuicServerSchema struct {
@ -169,6 +170,9 @@ func pointerOrDefaultTun(p *tunSchema, def LC.Tun) LC.Tun {
if p.UDPTimeout != nil {
def.UDPTimeout = *p.UDPTimeout
}
if p.FileDescriptor != nil {
def.FileDescriptor = *p.FileDescriptor
}
}
return def
}