Skip to content
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

Correct Host header for proxy tunnel CONNECT #374

Merged
merged 1 commit into from
Nov 19, 2012
Merged

Correct Host header for proxy tunnel CONNECT #374

merged 1 commit into from
Nov 19, 2012

Conversation

youurayy
Copy link
Contributor

As per RFC 2817, section 5.2 Requesting a Tunnel with CONNECT, there is a Host header to be set. The examples in the RFC use the same example host/port which is confusing, but logically, it makes no sense to use the same hostname in CONNECT statement and in the Host header. The Host header is meant to be set to the actual host to be proxied/tunelled to, and it looks like at least some of the proxies out there work that way.

I believe this also closes #367.

Notes:

  1. it would probably be ideal if the tunnel options were overridable from the main api, e.g. via opts = { tunnelOptions: { .. } }
  2. it would probably be better if the Host header for the tunnel was set after the logic for resolving the target hostname/port/protocol, which is below the tunnel config code, but it contains a few references to self.tunnel, so I'm not sure on that.

mikeal added a commit that referenced this pull request Nov 19, 2012
Correct Host header for proxy tunnel CONNECT
@mikeal mikeal merged commit 82d3cb1 into request:master Nov 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTPS does not work through Proxy
2 participants