Add documentation for socket_options
This commit is contained in:
parent
b9d9045a8b
commit
acd83dac70
@ -26,7 +26,18 @@ Configure the local address that the socket should be bound too. The most common
|
||||
|
||||
### `socket_options`
|
||||
|
||||
*TODO: Example*
|
||||
Configure the list of socket options to be applied to the underlying sockets used for network connections.
|
||||
For example, you can use it to explicitly specify which network interface should be used for the connection in this manner:
|
||||
|
||||
```python
|
||||
import httpx
|
||||
|
||||
socket_options = [(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, b"ETH999")]
|
||||
|
||||
network_options = httpx.NetworkOptions(
|
||||
socket_options=socket_options
|
||||
)
|
||||
```
|
||||
|
||||
### `uds`
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ from ._types import CertTypes, HeaderTypes, TimeoutTypes, URLTypes, VerifyTypes
|
||||
from ._urls import URL
|
||||
from ._utils import get_ca_bundle_from_env
|
||||
|
||||
__all__ = ["Limits", "Proxy", "Timeout", "create_ssl_context"]
|
||||
__all__ = ["Limits", "Proxy", "Timeout", "NetworkOptions", "create_ssl_context"]
|
||||
|
||||
SOCKET_OPTION = typing.Union[
|
||||
typing.Tuple[int, int, int],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user