Browse Source

update package

pull/15/head
Jason 5 years ago
parent
commit
45baff304b
  1. 15
      cmd/main.go
  2. 4
      cmd/main_fakedns.go
  3. 2
      cmd/main_stats.go
  4. 4
      proxy/tcp.go
  5. 4
      proxy/udp.go
  6. 2
      proxy/utils.go

15
cmd/main.go

@ -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")

4
cmd/main_fakedns.go

@ -6,14 +6,14 @@ import (
"flag"
"fmt"
"github.com/xjasonlyu/tun2socks/common/dns/fakedns"
"github.com/xjasonlyu/tun2socks/component/dns/fakedns"
)
func init() {
args.EnableFakeDNS = flag.Bool("fakeDNS", false, "Enable fake DNS")
args.DNSCacheSize = flag.Int("dnsCacheSize", 100, "Size of DNS LRU Cache")
args.FakeDNSAddr = flag.String("fakeDNSAddr", ":53", "Listen address of fake DNS")
args.FakeIPRange = flag.String("fakeIPRange", "198.18.0.1/16", "Fake IP CIDR range for DNS")
args.FakeIPRange = flag.String("fakeIPRange", "198.18.0.0/15", "Fake IP CIDR range for DNS")
args.FakeDNSHosts = flag.String("fakeDNSHosts", "", "DNS hosts mapping, e.g. 'example.com=1.1.1.1,example.net=2.2.2.2'")
addPostFlagsInitFn(func() {

2
cmd/main_stats.go

@ -5,7 +5,7 @@ package main
import (
"flag"
"github.com/xjasonlyu/tun2socks/common/stats/session"
"github.com/xjasonlyu/tun2socks/component/stats/session"
)
func init() {

4
proxy/tcp.go

@ -7,10 +7,10 @@ import (
"sync"
"time"
"github.com/xjasonlyu/tun2socks/common/dns"
"github.com/xjasonlyu/tun2socks/common/lsof"
"github.com/xjasonlyu/tun2socks/common/pool"
"github.com/xjasonlyu/tun2socks/common/stats"
"github.com/xjasonlyu/tun2socks/component/dns"
"github.com/xjasonlyu/tun2socks/component/stats"
"github.com/xjasonlyu/tun2socks/core"
"github.com/xjasonlyu/tun2socks/log"
)

4
proxy/udp.go

@ -7,10 +7,10 @@ import (
"sync"
"time"
"github.com/xjasonlyu/tun2socks/common/dns"
"github.com/xjasonlyu/tun2socks/common/lsof"
"github.com/xjasonlyu/tun2socks/common/pool"
"github.com/xjasonlyu/tun2socks/common/stats"
"github.com/xjasonlyu/tun2socks/component/dns"
"github.com/xjasonlyu/tun2socks/component/stats"
"github.com/xjasonlyu/tun2socks/core"
"github.com/xjasonlyu/tun2socks/log"
)

2
proxy/utils.go

@ -8,7 +8,7 @@ import (
"net"
"time"
"github.com/xjasonlyu/tun2socks/common/dns"
"github.com/xjasonlyu/tun2socks/component/dns"
"github.com/xjasonlyu/tun2socks/proxy/socks"
)

Loading…
Cancel
Save