From cb122ff3da48b7544a3f74b15b2dfdae619110df Mon Sep 17 00:00:00 2001 From: xvzc Date: Sat, 8 Jan 2022 00:39:58 +0900 Subject: [PATCH] update refactor --- proxy/proxy.go | 7 +++++++ util/doh.go | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index ba4770d..5eb4892 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -37,8 +37,14 @@ func Start() { util.Debug("Client sent data: ", len(message)) + util.Debug("") + util.Debug("Request : ") + util.Debug("\n" + string(message)) + method := util.ExtractMethod(&message) + if !util.IsValidMethod(method) { + util.Debug("Not a valid method: " + method) return } @@ -46,6 +52,7 @@ func Start() { ip, err := util.DnsLookupOverHttps(config.GetConfig().DNS, domain) // Dns lookup over https if err != nil { + log.Println("Error looking up dns: "+domain, err) return } diff --git a/util/doh.go b/util/doh.go index 012c551..d0252ec 100644 --- a/util/doh.go +++ b/util/doh.go @@ -1,8 +1,6 @@ package util import ( - "log" - "github.com/babolivier/go-doh-client" ) @@ -16,7 +14,6 @@ func DnsLookupOverHttps(dns string, domain string) (string, error) { Debug(domain) a, _, err := resolver.LookupA(domain) if err != nil { - log.Println("Error looking up dns. ", err) return "", err }