From ee8f7da4585dab40fa89b958d713fe28396d54d3 Mon Sep 17 00:00:00 2001 From: xvzc Date: Mon, 22 Jul 2024 20:58:30 +0900 Subject: [PATCH] fix log prefix --- proxy/http.go | 2 +- proxy/https.go | 12 ++++++------ proxy/proxy.go | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/proxy/http.go b/proxy/http.go index 67008ad..35d5c1d 100644 --- a/proxy/http.go +++ b/proxy/http.go @@ -9,7 +9,7 @@ import ( "github.com/xvzc/SpoofDPI/packet" ) -func (pxy *Proxy) HandleHttp(lConn *net.TCPConn, pkt *packet.HttpPacket, ip string) { +func (pxy *Proxy) handleHttp(lConn *net.TCPConn, pkt *packet.HttpPacket, ip string) { pkt.Tidy() // Create a connection to the requested server diff --git a/proxy/https.go b/proxy/https.go index 91c4bdc..57d5120 100644 --- a/proxy/https.go +++ b/proxy/https.go @@ -8,7 +8,7 @@ import ( "github.com/xvzc/SpoofDPI/packet" ) -func (pxy *Proxy) HandleHttps(lConn *net.TCPConn, initPkt *packet.HttpPacket, ip string) { +func (pxy *Proxy) handleHttps(lConn *net.TCPConn, initPkt *packet.HttpPacket, ip string) { // Create a connection to the requested server var port int = 443 var err error @@ -57,8 +57,8 @@ func (pxy *Proxy) HandleHttps(lConn *net.TCPConn, initPkt *packet.HttpPacket, ip chPkt := packet.NewHttpsPacket(clientHello) - lConn.SetLinger(3) - rConn.SetLinger(3) + // lConn.SetLinger(3) + // rConn.SetLinger(3) go Serve(rConn, lConn, "[HTTPS]", rConn.RemoteAddr().String(), initPkt.Domain(), pxy.timeout) @@ -111,7 +111,7 @@ func (pxy *Proxy) patternExists() bool { return pxy.allowedPattern != nil || pxy.allowedUrls != nil } -func (p *Proxy) patternMatches(bytes []byte) bool { - return (p.allowedPattern != nil && p.allowedPattern.Match(bytes)) || - (p.allowedUrls != nil && p.allowedUrls.Match(bytes)) +func (pxy *Proxy) patternMatches(bytes []byte) bool { + return (pxy.allowedPattern != nil && pxy.allowedPattern.Match(bytes)) || + (pxy.allowedUrls != nil && pxy.allowedUrls.Match(bytes)) } diff --git a/proxy/proxy.go b/proxy/proxy.go index adaeb9d..bcb4c6c 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -91,10 +91,10 @@ func (pxy *Proxy) Start() { if pkt.IsConnectMethod() { log.Debug("[PROXY] Start HTTPS") - pxy.HandleHttps(conn.(*net.TCPConn), pkt, ip) + pxy.handleHttps(conn.(*net.TCPConn), pkt, ip) } else { log.Debug("[PROXY] Start HTTP") - pxy.HandleHttp(conn.(*net.TCPConn), pkt, ip) + pxy.handleHttp(conn.(*net.TCPConn), pkt, ip) } }() }