From 526fe0ef9c670c4a159ae08c897f125e71e316f0 Mon Sep 17 00:00:00 2001 From: toriel Date: Tue, 23 Jan 2024 02:12:48 +0800 Subject: [PATCH] fix ipv6 too many colons --- .gitignore | 1 + examples/go.mod | 7 +++++++ ext/go.mod | 2 ++ go.mod | 4 ++++ https.go | 2 +- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1005f6f1..b1d53c3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ bin *.swp +.idea diff --git a/examples/go.mod b/examples/go.mod index 1dc42f00..d98e8764 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -1,8 +1,15 @@ module github.com/elazarl/goproxy/examples/goproxy-transparent +go 1.21.4 + require ( github.com/elazarl/goproxy v0.0.0-20181111060418-2ce16c963a8a github.com/inconshreveable/go-vhost v0.0.0-20160627193104-06d84117953b ) +require ( + github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 // indirect + github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4 // indirect +) + replace github.com/elazarl/goproxy => ../ diff --git a/ext/go.mod b/ext/go.mod index 2c6aa3ac..1628ca56 100644 --- a/ext/go.mod +++ b/ext/go.mod @@ -1,3 +1,5 @@ module github.com/elazarl/goproxy/ext +go 1.21.4 + require github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4 // indirect diff --git a/go.mod b/go.mod index 30554d58..7fb4c916 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,7 @@ module github.com/elazarl/goproxy +go 1.21.4 + require github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 + +require github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4 // indirect diff --git a/https.go b/https.go index 608863fa..48c0feee 100644 --- a/https.go +++ b/https.go @@ -112,7 +112,7 @@ func (proxy *ProxyHttpServer) handleHttps(w http.ResponseWriter, r *http.Request } ctx.Logf("Running %d CONNECT handlers", len(proxy.httpsHandlers)) - todo, host := OkConnect, r.URL.Host + todo, host := OkConnect, net.JoinHostPort(r.URL.Hostname(), r.URL.Port()) for i, h := range proxy.httpsHandlers { newtodo, newhost := h.HandleConnect(host, ctx)