Skip to content

feat: add custom hyper connector support#2879

Open
Dreaming-Codes wants to merge 2 commits into
seanmonstar:masterfrom
Dreaming-Codes:custom-hyper-connector
Open

feat: add custom hyper connector support#2879
Dreaming-Codes wants to merge 2 commits into
seanmonstar:masterfrom
Dreaming-Codes:custom-hyper-connector

Conversation

@Dreaming-Codes

Copy link
Copy Markdown

Summary

  • Add custom-hyper-connector feature flag that allows users to provide their own hyper-compatible connector
  • Enables use cases like WireGuard tunnels, custom TLS implementations, and network virtualization (e.g., smoltcp)
  • Includes two examples: custom_connector.rs (basic) and tor_arti.rs (Arti Tor client integration)

Changes

  • New ClientBuilder::custom_connector() method accepting any Service<Uri> that returns a connection implementing Read + Write + Connection
  • New connector module exporting types needed for custom connector implementations
  • Examples demonstrating custom TCP/TLS connectors and Arti Tor integration

Closes #1535
Closes #2633
Closes #1321

@Dreaming-Codes

Copy link
Copy Markdown
Author

Another example is also available here https://github.com/Dreaming-Codes/wireguard-hyper-connector/blob/master/examples/reqwest_custom_connector.rs

# Conflicts:
#	src/async_impl/client.rs
#	src/connect.rs
@Dreaming-Codes

Copy link
Copy Markdown
Author

@seanmonstar Anything missing to merge this?

@Daanoz

Daanoz commented Feb 6, 2026

Copy link
Copy Markdown

I have just tried this branch for my use case: an mTLS connection with the private key in an HSM only accessible via a PKCS#11 URI using an OpenSSL Provider.
I already had created a Hyper Connector that supports this, and I could directly use it's implementation with your branch without modifications!

I would love to be able to use reqwest for our applications, happy to help with any validation work if needed!

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.

Provide custom TCP stream Support for custom hyper client Support arbitrary proxy

2 participants