fix log format

This commit is contained in:
xvzc 2024-07-22 20:24:35 +09:00
parent ed70bde7e7
commit a93b564d60
3 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ func (d *DnsResolver) Lookup(domain string) (string, error) {
response, _, err := c.Exchange(msg, dnsServer)
if err != nil {
return "", errors.New(" couldn't resolve the domain")
return "", errors.New("couldn not resolve the domain")
}
for _, answer := range response.Answer {
@ -58,7 +58,7 @@ func (d *DnsResolver) Lookup(domain string) (string, error) {
}
}
return "", errors.New("[DNS] couldn't resolve the domain")
return "", errors.New("couldn not resolve the domain")
}
func dohLookup(domain string) (string, error) {
@ -68,7 +68,7 @@ func dohLookup(domain string) (string, error) {
rsp, err := c.Query(ctx, dohDns.Domain(domain), dohDns.TypeA)
if err != nil {
return "", errors.New("[DOH] couldn't resolve the domain")
return "", errors.New("could not resolve the domain")
}
// doh dns answer
answer := rsp.Answer
@ -86,5 +86,5 @@ func dohLookup(domain string) (string, error) {
// close the client
c.Close()
return "", errors.New("[DOH] couldn't resolve the domain")
return "", errors.New("couldn not resolve the domain")
}

View File

@ -18,7 +18,7 @@ func (pxy *Proxy) HandleHttp(lConn *net.TCPConn, pkt *packet.HttpPacket, ip stri
if pkt.Port() != "" {
port, err = strconv.Atoi(pkt.Port())
if err != nil {
log.Debug("[HTTPS] Error while parsing port for ", pkt.Domain(), " aborting..")
log.Debug("[HTTP] Error while parsing port for ", pkt.Domain(), " aborting..")
}
}

View File

@ -84,7 +84,7 @@ func (pxy *Proxy) Start() {
// Avoid recursively querying self
if pkt.Port() == strconv.Itoa(pxy.port) && isLoopedRequest(net.ParseIP(ip)) {
log.Error("[HTTP] Invalid request: final target has the same IP and port as our proxy")
log.Error("[PROXY] Looped request has been detected. aborting.")
conn.Close()
return
}