go-gost / gost

GO Simple Tunnel - a simple tunnel written in golang
https://gost.run
MIT License
4.39k stars 528 forks source link

请求添加tun隧道fd模式 #465

Open openwrt2223 opened 7 months ago

openwrt2223 commented 7 months ago

@ginuerzh 请求添加tun隧道fd模式。 两个相关函数CreateTUNFromFile和CreateUnmonitoredTUNFromFD链接: https://pkg.go.dev/golang.zx2c4.com/wireguard/tun#CreateTUNFromFile https://pkg.go.dev/golang.zx2c4.com/wireguard/tun#CreateUnmonitoredTUNFromFD 官方实现用CreateTUNFromFile,详见https://git.zx2c4.com/wireguard-go/tree/main.go 用途 在没有root权限的情况下使用tun,比如android

openwrt2223 commented 7 months ago

@ginuerzh https://github.com/WireGuard/wireguard-android/blob/master/tunnel/tools/libwg-go/api-android.go 使用的是CreateUnmonitoredTUNFromFD