-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support custom HTTP headers for CONNECT proxy request #479
Labels
Comments
Fix this issue by adding a ProxyConnectHeader to Dialer and use this header connecting through a proxy. |
Untill this feature gets properly implemented into the main branch, you can use my version. dialer := websocket.Dialer{
Proxy: http.ProxyURL(&url.URL{
Scheme: "http",
Host: "127.0.0.1:6969",
Path: "/",
}),
ProxyConnectHeaders: map[string]string{
"Proxy-Auth": "user:pass",
"Proxy-Geo": "EU",
},
} |
AllenX2018
pushed a commit
to AllenX2018/websocket
that referenced
this issue
Jun 15, 2020
AllenX2018
pushed a commit
to AllenX2018/websocket
that referenced
this issue
Jun 15, 2020
Closed
AllenX2018
added a commit
to AllenX2018/websocket
that referenced
this issue
Sep 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When an HTTP proxy is used, there is no way to customize the headers in the initial CONNECT request. In some situations, a HTTP proxy may require certain User-Agents or other headers. golang added support for this in
net/http
in 1.8. The golang issue is documented here with support added in 1.8 as documented here.Note, this is not the same as providing a
requestHeader
toConn.NewClient
orDialer.Dial
. These headers are only present after the initial CONNECT request to the HTTP proxy.The text was updated successfully, but these errors were encountered: