mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-14 20:58:33 +10:00
Add Tailscale endpoint
This commit is contained in:
16
protocol/tailscale/protect_android.go
Normal file
16
protocol/tailscale/protect_android.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package tailscale
|
||||
|
||||
import (
|
||||
"github.com/sagernet/sing-box/experimental/libbox/platform"
|
||||
"github.com/sagernet/tailscale/net/netns"
|
||||
)
|
||||
|
||||
func setAndroidProtectFunc(platformInterface platform.Interface) {
|
||||
if platformInterface != nil {
|
||||
netns.SetAndroidProtectFunc(func(fd int) error {
|
||||
return platformInterface.AutoDetectInterfaceControl(fd)
|
||||
})
|
||||
} else {
|
||||
netns.SetAndroidProtectFunc(nil)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user