Skip to content

affected/package: net/http #61047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sywc670 opened this issue Jun 28, 2023 · 1 comment
Closed

affected/package: net/http #61047

sywc670 opened this issue Jun 28, 2023 · 1 comment

Comments

@sywc670
Copy link

sywc670 commented Jun 28, 2023

What version of Go are you using (go version)?

$ go version
1.20.5

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\will\AppData\Local\go-build        
set GOENV=C:\Users\will\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\will\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=github.com/marmotedu/*
set GOOS=windows
set GOPATH=C:\Users\will\go
set GOPRIVATE=
set GOPROXY=https://goproxy.io,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64

set GOVCS=
set GOVERSION=go1.20.5
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=E:\开发\go\goplayground\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\will\AppData\Local\Temp\go-build2922334793=/tmp/go-build -gno-record-gcc-switches

What did you do?

run code as proxy
https://go.dev/play/p/XV_LDHcYKeB

make a http request with method CONNECT to any url using env variable http_proxy
http_proxy=192.168.101.11:8080 curl -XCONNECT www.baidu.com

What did you expect to see?

r.URL.Host is "www.baidu.com:80"?

When succeed the proxy should forward the request. Then return 403.

What did you see instead?

output:
2023/06/28 18:03:01 HTTP隧道服务器已启动,监听端口:8080
2023/06/28 18:03:17 无法连接到目标主机:dial tcp: lookup http: no such host

cause:
r.URL.Host is "http:"
r.URL.Path is "//www.baidu.com/"
So the parse process of CONNECT request may be wrong?

@seankhliao
Copy link
Member

That's curl sending an invalid request.
CONNECT takes the formCONNECT www.example.com:443 HTTP/1.1 without a scheme

closing as not a bug

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2023
@golang golang locked and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants