sbstp / attohttpc

Rust lightweight HTTP 1.1 client

Home Page:https://docs.rs/attohttpc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Low-level hooks / custom connectors

sbstp opened this issue · comments

Initially suggested by @adamreichold here.

Generally, allow people to hook into the logic of the library to customize the behavior. A few places where this might be useful:

  • Initializing TCP connection
  • Initializing TLS
  • Handling redirection responses
  • Providing a custom stream implementation that implements a request timeout
  • Tracing and debugging

@sbstp I would prefer if we closed this as you made your API design choice clear and I fear this here would run counter to it. I think it is best if we try to do one way well instead of making things too complicated by providing every possible way. (The only thing here I still as useful would be to pass a preconfigured TlsConnector to handle things like client certificates to avoid having to basically provide wrapper for all of TlsConnectorBuilder.)