mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-18 14:50:45 +08:00
bug fixes & cleanup
This commit is contained in:
@@ -77,7 +77,7 @@ func main() {
|
||||
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 prefixlen (a number) for IPv6 address")
|
||||
args.TunDns = flag.String("tunDns", "1.1.1.1", "DNS resolvers for TUN interface (Windows Only)")
|
||||
args.ProxyType = flag.String("proxyType", "socks", "Proxy handler type")
|
||||
args.ProxyType = flag.String("proxyType", "socks, exception", "Proxy handler type")
|
||||
args.DelayICMP = flag.Int("delayICMP", 1, "Delay ICMP packets for a short period of time, in milliseconds")
|
||||
args.LogLevel = flag.String("loglevel", "info", "Logging level. (info, warning, error, debug, silent)")
|
||||
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/xjasonlyu/tun2socks/common/log"
|
||||
"github.com/xjasonlyu/tun2socks/core"
|
||||
"github.com/xjasonlyu/tun2socks/proxy/d"
|
||||
"github.com/xjasonlyu/tun2socks/proxy/exception"
|
||||
"github.com/xjasonlyu/tun2socks/proxy/socks"
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
args.ExceptionApps = flag.String("exceptionApps", "", "A list of exception apps separated by commas")
|
||||
args.ExceptionSendThrough = flag.String("exceptionSendThrough", "192.168.1.101:0", "Exception send through address")
|
||||
|
||||
registerHandlerCreator("d", func() {
|
||||
registerHandlerCreator("exception", func() {
|
||||
// Verify proxy server address.
|
||||
proxyAddr, err := net.ResolveTCPAddr("tcp", *args.ProxyServer)
|
||||
if err != nil {
|
||||
@@ -34,8 +34,8 @@ func init() {
|
||||
log.Fatalf("invalid exception send through address: %v", err)
|
||||
}
|
||||
apps := strings.Split(*args.ExceptionApps, ",")
|
||||
tcpHandler := d.NewTCPHandler(proxyTCPHandler, apps, sendThrough)
|
||||
udpHandler := d.NewUDPHandler(proxyUDPHandler, apps, sendThrough, *args.UdpTimeout)
|
||||
tcpHandler := exception.NewTCPHandler(proxyTCPHandler, apps, sendThrough)
|
||||
udpHandler := exception.NewUDPHandler(proxyUDPHandler, apps, sendThrough, *args.UdpTimeout)
|
||||
|
||||
core.RegisterTCPConnHandler(tcpHandler)
|
||||
core.RegisterUDPConnHandler(udpHandler)
|
||||
|
Reference in New Issue
Block a user