From 13c193f24f6238e3e2c36f4d6bc9d1615c23cdd0 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 14 Aug 2019 21:20:40 +0800 Subject: [PATCH] debug --- proxy/tcp.go | 3 +++ proxy/utils.go | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy/tcp.go b/proxy/tcp.go index b3d28d0..d22c2ec 100644 --- a/proxy/tcp.go +++ b/proxy/tcp.go @@ -85,6 +85,9 @@ func (h *tcpHandler) Handle(conn net.Conn, target *net.TCPAddr) error { // Alias var localConn = conn + if h.fakeDNS == nil { + log.Warnf("fakedns is nil") + } // Lookup fakeDNS host record targetHost, err := lookupHost(h.fakeDNS, target) if err != nil { diff --git a/proxy/utils.go b/proxy/utils.go index 0127355..e0ef4d7 100644 --- a/proxy/utils.go +++ b/proxy/utils.go @@ -3,7 +3,6 @@ package proxy import ( "errors" "fmt" - "github.com/xjasonlyu/tun2socks/common/log" "io" "io/ioutil" "net" @@ -29,7 +28,6 @@ func lookupHost(fakeDNS dns.FakeDNS, target net.Addr) (targetHost string, err er targetHost = targetIP.String() // Replace with a domain name if target address IP is a fake IP if fakeDNS != nil { - log.Warnf("lookup dns: %v", targetHost) if host, exist := fakeDNS.IPToHost(targetIP); exist { targetHost = host }