Skip to content

Commit

Permalink
chore: fix dialer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LyleMi committed Jan 10, 2024
1 parent be41733 commit 8250ecb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net/http"
"os"
"strings"
"time"

utls "github.com/refraction-networking/utls"
)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8250ecb

Please sign in to comment.