|
|
@ -1,5 +1,6 @@ |
|
|
|
package main |
|
|
|
|
|
|
|
import "C" |
|
|
|
import ( |
|
|
|
"flag" |
|
|
|
"fmt" |
|
|
@ -12,15 +13,15 @@ import ( |
|
|
|
"syscall" |
|
|
|
"time" |
|
|
|
|
|
|
|
C "github.com/xjasonlyu/tun2socks/constant" |
|
|
|
"github.com/xjasonlyu/tun2socks/core" |
|
|
|
"github.com/xjasonlyu/tun2socks/filter" |
|
|
|
"github.com/xjasonlyu/tun2socks/log" |
|
|
|
"github.com/xjasonlyu/tun2socks/proxy" |
|
|
|
"github.com/xjasonlyu/tun2socks/tun" |
|
|
|
|
|
|
|
D "github.com/xjasonlyu/tun2socks/common/dns" |
|
|
|
S "github.com/xjasonlyu/tun2socks/common/stats" |
|
|
|
C "github.com/xjasonlyu/tun2socks/constant" |
|
|
|
D "github.com/xjasonlyu/tun2socks/component/dns" |
|
|
|
S "github.com/xjasonlyu/tun2socks/component/stats" |
|
|
|
) |
|
|
|
|
|
|
|
const MTU = 1500 |
|
|
@ -65,13 +66,13 @@ func addPostFlagsInitFn(fn func()) { |
|
|
|
|
|
|
|
func init() { |
|
|
|
// Main
|
|
|
|
args.Version = flag.Bool("version", false, "Print version") |
|
|
|
args.LogLevel = flag.String("loglevel", "info", "Logging level. (info, warning, error, debug, silent)") |
|
|
|
args.TunName = flag.String("tunName", "tun0", "TUN interface name") |
|
|
|
args.Version = flag.Bool("version", false, "Show version") |
|
|
|
args.LogLevel = flag.String("loglevel", "info", "Logging level [info, warning, error, debug, silent]") |
|
|
|
args.TunName = flag.String("tunName", "utun0", "TUN interface name") |
|
|
|
args.TunAddr = flag.String("tunAddr", "240.0.0.2", "TUN interface address") |
|
|
|
args.TunGw = flag.String("tunGw", "240.0.0.1", "TUN interface gateway") |
|
|
|
args.TunMask = flag.String("tunMask", "255.255.255.0", "TUN interface netmask, it should be a prefix length (a number) for IPv6 address") |
|
|
|
args.TunDNS = flag.String("tunDNS", "1.1.1.1", "DNS resolvers for TUN interface (Windows Only)") |
|
|
|
args.TunDNS = flag.String("tunDNS", "", "DNS resolvers for TUN interface (Windows Only)") |
|
|
|
|
|
|
|
// Proxy
|
|
|
|
args.ProxyServer = flag.String("proxyServer", "", "Proxy server address") |
|
|
|