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("Client sent data: ", len(message))
|
||||||
|
|
||||||
|
util.Debug("")
|
||||||
|
util.Debug("Request : ")
|
||||||
|
util.Debug("\n" + string(message))
|
||||||
|
|
||||||
method := util.ExtractMethod(&message)
|
method := util.ExtractMethod(&message)
|
||||||
|
|
||||||
if !util.IsValidMethod(method) {
|
if !util.IsValidMethod(method) {
|
||||||
|
util.Debug("Not a valid method: " + method)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +52,7 @@ func Start() {
|
|||||||
|
|
||||||
ip, err := util.DnsLookupOverHttps(config.GetConfig().DNS, domain) // Dns lookup over https
|
ip, err := util.DnsLookupOverHttps(config.GetConfig().DNS, domain) // Dns lookup over https
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Println("Error looking up dns: "+domain, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/babolivier/go-doh-client"
|
"github.com/babolivier/go-doh-client"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -16,7 +14,6 @@ func DnsLookupOverHttps(dns string, domain string) (string, error) {
|
|||||||
Debug(domain)
|
Debug(domain)
|
||||||
a, _, err := resolver.LookupA(domain)
|
a, _, err := resolver.LookupA(domain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error looking up dns. ", err)
|
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user