Get darwin local DNS server from libresolv

This commit is contained in:
世界
2025-02-20 16:40:53 +08:00
parent cf008519fd
commit ac4e30b190
7 changed files with 90 additions and 27 deletions

3
protocol/tun/hook.go Normal file
View File

@@ -0,0 +1,3 @@
package tun
var HookBeforeCreatePlatformInterface func()

View File

@@ -361,6 +361,9 @@ func (t *Inbound) Start(stage adapter.StartStage) error {
if t.platformInterface != nil {
tunInterface, err = t.platformInterface.OpenTun(&tunOptions, t.platformOptions)
} else {
if HookBeforeCreatePlatformInterface != nil {
HookBeforeCreatePlatformInterface()
}
tunInterface, err = tun.New(tunOptions)
}
monitor.Finish()