From 8250ecbcd60ecaff01d9290a1a6a95b9bbd13d0f Mon Sep 17 00:00:00 2001 From: lyle Date: Wed, 10 Jan 2024 09:16:31 +0800 Subject: [PATCH] chore: fix dialer bug --- proxy.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy.go b/proxy.go index bb5657b..f73eaa3 100644 --- a/proxy.go +++ b/proxy.go @@ -9,7 +9,6 @@ import ( "net/http" "os" "strings" - "time" utls "github.com/refraction-networking/utls" ) @@ -41,7 +40,9 @@ func customTLSWrap(conn net.Conn, sni string) (*utls.UConn, error) { func handleTunneling(w http.ResponseWriter, r *http.Request) { log.Printf("proxy to %s", r.Host) - destConn, err := net.DialTimeout("tcp", r.Host, 10*time.Second) + + destConn, err := CustomDialer.Dial("tcp", r.Host) + if err != nil { http.Error(w, err.Error(), http.StatusServiceUnavailable) log.Println("Tunneling err", err)