Closed robsmith11 closed 3 years ago
short answer: yes, at least for the curl/isahc client.
long answer: you're going to need to piece it together
By default Surf uses IsahcClient
i.e. libcurl.
You'll need to create one from an isahc::Client
: https://github.com/http-rs/http-client/blob/83b7fb0c1c55051362de22f389be49b65ca85754/src/isahc.rs#L24-L27
Which you'll need to build via isahc::HttpClientBuilder
and use methods from the isahc::config::Configurable
trait: https://docs.rs/isahc/0.9.10/isahc/struct.HttpClientBuilder.html#impl-Configurable
And the specific setting you'd be looking for is https://docs.rs/isahc/1.0.3/isahc/config/trait.Configurable.html#method.tcp_nodelay
Thanks! I got a bit lost with different layers of abstraction..
So it's not possible to call the config methods on the static default client? Also, I saw that "h1" might become the default http client. Is it possible to set TCP_NODELAY there too?
So it's not possible to call the config methods on the static default client?
It is not possible to configure the default client at this time.
Is it possible to set TCPNODELAY there (h1 client)_ too?
Not at present. async-std does support TCP_NODELAY, so it would have to be added to this part of http-client: https://github.com/http-rs/http-client/blob/a9928a05732bdbcb33551de1ee2d37f60a43b44f/src/h1.rs#L59-L70
However, http-client currently does not have any way of specify options, see this issue for the beginning of that discussion: https://github.com/http-rs/http-client/issues/61
WIP draft PR up for the API in http-client: https://github.com/http-rs/http-client/pull/84
Available in https://github.com/http-rs/surf/releases/tag/v2.3.0
I don't see any way to set TCP_NODELAY (when using linux). Is it not possible?