mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +00:00
feat: improve logging messages in rewriter
This commit is contained in:
parent
5a3bbb6f4d
commit
bcee915783
@ -7,5 +7,5 @@ License: GPL-3.0-only
|
|||||||
Section: net
|
Section: net
|
||||||
SourceDateEpoch: 1711267200
|
SourceDateEpoch: 1711267200
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Installed-Size: 4505600
|
Installed-Size: 6307840
|
||||||
Description: Advanced HTTP User-Agent Rewriting Tool.
|
Description: Advanced HTTP User-Agent Rewriting Tool.
|
||||||
|
|||||||
@ -7,5 +7,5 @@ License: GPL-3.0-only
|
|||||||
Section: net
|
Section: net
|
||||||
SourceDateEpoch: 1711267200
|
SourceDateEpoch: 1711267200
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Installed-Size: 4505600
|
Installed-Size: 6307840
|
||||||
Description: Advanced HTTP User-Agent Rewriting Tool.
|
Description: Advanced HTTP User-Agent Rewriting Tool.
|
||||||
|
|||||||
@ -167,7 +167,7 @@ func (r *Rewriter) ProxyHTTPOrRaw(dst net.Conn, src net.Conn, destAddr string, s
|
|||||||
|
|
||||||
if strings.HasSuffix(destAddr, "443") && isTLSClientHello(reader) {
|
if strings.HasSuffix(destAddr, "443") && isTLSClientHello(reader) {
|
||||||
r.Cache.Add(destAddr, destAddr)
|
r.Cache.Add(destAddr, destAddr)
|
||||||
log.LogDebugWithAddr(srcAddr, destAddr, "TLS ClientHello detected")
|
log.LogInfoWithAddr(srcAddr, destAddr, "tls client hello detected, pass forward")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
isHTTP, err := r.isHTTP(reader)
|
isHTTP, err := r.isHTTP(reader)
|
||||||
@ -177,7 +177,7 @@ func (r *Rewriter) ProxyHTTPOrRaw(dst net.Conn, src net.Conn, destAddr string, s
|
|||||||
}
|
}
|
||||||
if !isHTTP {
|
if !isHTTP {
|
||||||
r.Cache.Add(destAddr, destAddr)
|
r.Cache.Add(destAddr, destAddr)
|
||||||
log.LogDebugWithAddr(srcAddr, destAddr, "Not HTTP, added to LRU Relay Cache")
|
log.LogInfoWithAddr(srcAddr, destAddr, "Not HTTP, added to LRU Relay Cache")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,10 +194,10 @@ func (r *Rewriter) ProxyHTTPOrRaw(dst net.Conn, src net.Conn, destAddr string, s
|
|||||||
if !isHTTP {
|
if !isHTTP {
|
||||||
h2, _ := reader.Peek(2) // ensure we have at least 2 bytes
|
h2, _ := reader.Peek(2) // ensure we have at least 2 bytes
|
||||||
if isWebSocket(h2) {
|
if isWebSocket(h2) {
|
||||||
log.LogDebugWithAddr(srcAddr, destAddr, "WebSocket detected, pass-through")
|
log.LogInfoWithAddr(srcAddr, destAddr, "WebSocket detected, pass-through")
|
||||||
} else {
|
} else {
|
||||||
r.Cache.Add(destAddr, destAddr)
|
r.Cache.Add(destAddr, destAddr)
|
||||||
log.LogDebugWithAddr(srcAddr, destAddr, "Not HTTP, added to LRU Relay Cache")
|
log.LogInfoWithAddr(srcAddr, destAddr, "Not HTTP, added to LRU Relay Cache")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user