mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2025-01-03 04:50:11 +00:00
update refactor
This commit is contained in:
parent
f7d7f37986
commit
cb122ff3da
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user