Feature: windows tun more params support

Supported params:

- Name
- MTU
- ComponentID
- Network
This commit is contained in:
xjasonlyu
2021-02-06 16:20:45 +08:00
parent 38b9357469
commit b1700c62f4
3 changed files with 50 additions and 5 deletions

15
engine/tun.go Normal file
View File

@@ -0,0 +1,15 @@
// +build !windows
package engine
import (
"net/url"
"github.com/xjasonlyu/tun2socks/device"
"github.com/xjasonlyu/tun2socks/device/tun"
)
func openTUN(u *url.URL, mtu uint32) (device.Device, error) {
name := u.Host
return tun.Open(tun.WithName(name), tun.WithMTU(mtu))
}