Add httpx.NetworkOptions
configuration.
#3052
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs #947 (comment)
Here's how the proposed documentation looks...
Network Options
There are several advanced network options that are made available through the
httpx.NetworkOptions
configuration class.Configuration
The options available on this class are...
connection_retries
Configure a number of retries that may be attempted when initially establishing a TCP connection. Defaults to
0
.local_address
Configure the local address that the socket should be bound too. The most common usage is for enforcing binding to either IPv4
local_address="0.0.0.0"
or IPv6local_address="::"
.socket_options
TODO: Example
uds
Connect to a Unix Domain Socket, rather than over the network. Should be a string providing the path to the UDS.
Design options that we have here...
httpx.Client(network_options=...)
shortcut, in the same way we do for eg.ssl_context=...
,proxy=...
,limits=...
,version=...
.Limits
andNetworkOptions
all be part of the same single config class. Includingmax_keepalive_connections
,max_connections
,keepalive_expiry
on this class.