We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We should add a socket_options configuration to the ConnectionPool and HTTPProxy classes.
socket_options
ConnectionPool
HTTPProxy
This would need to be passed through to the network backends connect_tcp(...) and connect_unix_socket() methods.
connect_tcp(...)
connect_unix_socket()
For example the sync case, here...
httpcore/httpcore/backends/sync.py
Lines 80 to 97 in 21450a7
...which we would adapt to something like this...
def connect_tcp( self, host: str, port: int, timeout: typing.Optional[float] = None, local_address: typing.Optional[str] = None, socket_options: typing.Sequence[typing.Tuple[int, int, typing.Union[int, bytes]]] = () ) -> NetworkStream: address = (host, port) source_address = None if local_address is None else (local_address, 0) exc_map: ExceptionMapping = { socket.timeout: ConnectTimeout, OSError: ConnectError, } with map_exceptions(exc_map): sock = socket.create_connection( address, timeout, source_address=source_address ) # See https://docs.python.org/3/library/socket.html#socket.socket.setsockopt for option in socket_options: sock.setsockopt(*option) return SyncStream(sock)
This would resolve #651 and encode/httpx#2635
We could also consider changing our defaults for TCP_NODELAY, but we should consider that option as a follow-up.
TCP_NODELAY
The text was updated successfully, but these errors were encountered:
We'd also want to then push this configuration through to httpx.HTTPTransport.
httpx.HTTPTransport
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
We should add a
socket_options
configuration to theConnectionPool
andHTTPProxy
classes.This would need to be passed through to the network backends
connect_tcp(...)
andconnect_unix_socket()
methods.For example the sync case, here...
httpcore/httpcore/backends/sync.py
Lines 80 to 97 in 21450a7
...which we would adapt to something like this...
This would resolve #651 and encode/httpx#2635
We could also consider changing our defaults for
TCP_NODELAY
, but we should consider that option as a follow-up.The text was updated successfully, but these errors were encountered: