-
Notifications
You must be signed in to change notification settings - Fork 52
feat: unstable HttpClient Config #86
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
Conversation
be9c60f
to
ad3d8c9
Compare
This adds an `unstable-config` feature, with a new `Config` struct, which can be used to configure any `HttpClient` which implements support for it. Currently it supports two features - the most important and most generally supported: - `timeout` (`Duration`) - `no_delay` (`bool`) Implementations are provided for async-h1, isahc, and hyper (partial, no `no_delay` support due to the tls connector). No serious attempt has been made to add this to the wasm client at this point, since I don't understand well how to even build the wasm client or if it even works anymore with the state of rust wasm web build tools.
Updated with an |
I think I've mentioned this before, but I'd be curious how tls configuration fits into this — would that be a later enhancement? |
Also renamed `no_delay` to `tcp_no_delay`. the options for configuring this in Isahc and Hyper are unfortunately not super clear.
We could support PEM or DER encoded X.509 certificates for isahc and async-native-tls, and maybe a couple extra options:
EDIT: Turns out I was very wrong and these things do indeed have configuration for this but it's a little hidden. |
Ok updated with tls options for the async-h1 client. Different configuration is accepted depending if This is not implemented for the isahc or hyper clients as those can be set directly and then wrapped, and the complexity of doing that integration fully would be too substantial for this PR. |
6266127
to
5e793df
Compare
Only supports the h1 client, but has two different options, one each for native-tls and rustls.
I'd rather avoid |
merging this as an unstable feature and releasing it. |
Finally adds top-level configuration to surf, built on top of http-client's still as of yet unstable config. Related to http-rs/http-client#86 Closes http-rs#274 Closes http-rs#277
Finally adds top-level configuration to surf, built on top of http-client's still as of yet unstable config. Related to http-rs/http-client#86 Closes http-rs#274 Closes http-rs#277
Finally adds top-level configuration to surf, built on top of http-client's still as of yet unstable config. Related to http-rs/http-client#86 Closes http-rs#274 Closes http-rs#277
Finally adds top-level configuration to surf, built on top of http-client's still as of yet unstable config. Related to http-rs/http-client#86 Closes http-rs#274 Closes http-rs#277
I've been using this in projects for a couple months now, and would like to land support in Surf directly, for which this should be stabilized. Refs: http-rs/surf#310 Refs: http-rs#86 Closes: http-rs#93
I've been using this in projects for a couple months now, and would like to land support in Surf directly, for which this should be stabilized. Refs: http-rs/surf#310 Refs: http-rs#86 Closes: http-rs#93
I've been using this in projects for a couple months now, and would like to land support in Surf directly, for which this should be stabilized. Refs: http-rs/surf#310 Refs: http-rs#86 Closes: http-rs#93
I've been using this in projects for a couple months now, and would like to land support in Surf directly, for which this should be stabilized. Refs: http-rs/surf#310 Refs: http-rs#86 Closes: http-rs#93
Finally adds top-level configuration to surf, built on top of http-client's newly stabilized `Config`. Related to http-rs/http-client#86 Closes http-rs#274 Closes http-rs#277
Released into Surf: https://github.com/http-rs/surf/releases/tag/v2.3.0 |
This adds an
unstable-config
feature, with a newConfig
struct, which can be used to configure anyHttpClient
which implements support for it.Currently it supports two features - the most important and most generally supported:
timeout
(Duration
)tcp_no_delay
(bool
)Implementations are provided for async-h1, isahc, and hyper (partial, no
no_delay
support due to the tls connector).No serious attempt has been made to add this to the wasm client at this point, since I don't understand well how to even build the wasm client or if it even works anymore with the state of rust wasm web build tools.
This represents the development of the older draft PR: #84
Should address #61
Possible next targets:
http_keep_alive
on/off (Requires a lot of code shuffling in the h1 client)ttl
(Does not appear to be accessible from hyper)max_connections
- a slightly haphazard api by the h1 client