Use API to create windows firewall rule

This commit is contained in:
世界 2023-06-07 21:01:29 +08:00
parent f8d5f01665
commit 01dfba722a
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
6 changed files with 18 additions and 4 deletions

View file

@ -270,7 +270,8 @@ func NewRouter(
router.networkMonitor = networkMonitor
networkMonitor.RegisterCallback(router.interfaceFinder.update)
interfaceMonitor, err := tun.NewDefaultInterfaceMonitor(router.networkMonitor, tun.DefaultInterfaceMonitorOptions{
OverrideAndroidVPN: options.OverrideAndroidVPN,
OverrideAndroidVPN: options.OverrideAndroidVPN,
UnderNetworkExtension: platformInterface != nil && platformInterface.UnderNetworkExtension(),
})
if err != nil {
return nil, E.New("auto_detect_interface unsupported on current platform")