Skip to content
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

Add socket_options to httpx.HTTPTransport. #2715

Closed
tomchristie opened this issue May 23, 2023 · 0 comments · Fixed by #2716
Closed

Add socket_options to httpx.HTTPTransport. #2715

tomchristie opened this issue May 23, 2023 · 0 comments · Fixed by #2716
Labels
enhancement New feature or request

Comments

@tomchristie
Copy link
Member

Since version 0.17.2 the httpcore package has support for a socket_options parameter.
We should add a corresponding parameter to httpx.HTTPTransport, which can be passed through to the connection pool.

This will resolve the use-case raised in discussion #2635...

>>> import httpx
>>> socket_options = [(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, b"ETH999")]
>>> transport = httpx.HTTPTransport(socket_options=socket_options)
>>> client = httpx.Client(transport=transport)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant