Skip to content

Add socket_options to httpx.HTTPTransport. #2715

Closed

Description

@lovelydinosaur

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions