hyperium / hyperium/hyper

CONNECT requests not really doable in the current client setup

Open
#2,560 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-client B-rfc
Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

CONNECT requests, be them h1 or h2, are not really doable through the Hyper client, with the current connector design.

hyper::client::Client::request takes a request, extracts the (scheme, host, port) triple from its URI, and then passes that to its inner connector.

That means that for a CONNECT example.org:80 request, the connector will try to connect to example.org:80 to then send the CONNECT request to it. That's obviously not what you want when doing CONNECT requests.

I ended up making a new ProxyConnector<C> connector that completely ignores the uri argument of <Service<Uri>>::call, but that sounds like a workaround and there is probably a better way to handle that in Hyper itself.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing hyper::client::Client::request and the Service::call contract, paying attention to how h1 and h2 CONNECT requests reach the connector. Define the connector behavior needed for CONNECT without relying on the request target as the connection destination; done means both forms can be handled through Hyper without a custom workaround connector.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.