-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fixing missed arguments for pools when init transports #857
base: master
Are you sure you want to change the base?
Conversation
Let's start with an understanding of what a proper signature for http proxy connections is. Here is the signature of class AsyncForwardHTTPConnection(AsyncConnectionInterface):
def __init__(
self,
proxy_origin: Origin,
remote_origin: Origin,
proxy_headers: Union[HeadersAsMapping, HeadersAsSequence, None] = None,
keepalive_expiry: Optional[float] = None,
network_backend: Optional[AsyncNetworkBackend] = None,
socket_options: Optional[Iterable[SOCKET_OPTION]] = None,
proxy_ssl_context: Optional[ssl.SSLContext] = None,
) -> None: I believe we are missing a few parameters here, as it is simply a wrapper for the AsyncHTTPConnection, which has the following signature: class AsyncHTTPConnection(AsyncConnectionInterface):
def __init__(
self,
origin: Origin,
ssl_context: Optional[ssl.SSLContext] = None,
keepalive_expiry: Optional[float] = None,
http1: bool = True,
http2: bool = False,
retries: int = 0,
local_address: Optional[str] = None,
uds: Optional[str] = None,
network_backend: Optional[AsyncNetworkBackend] = None,
socket_options: Optional[Iterable[SOCKET_OPTION]] = None,
) -> None: The constructor of self._connection = AsyncHTTPConnection(
origin=proxy_origin,
keepalive_expiry=keepalive_expiry,
network_backend=network_backend,
socket_options=socket_options,
ssl_context=proxy_ssl_context,
)
self._proxy_origin = proxy_origin
self._proxy_headers = enforce_headers(proxy_headers, name="proxy_headers")
self._remote_origin = remote_origin So we need all of the arguments from Here are the arguments that the proxy class lacks:
Also, in the |
Understood, thanks for this @NewUserHa. |
The |
In this PR, we can simply enforce the ordering of For |
The HttpProxy and Socks5Proxy only need either proxy_url or uds, should default proxy_url to ""? |
discussion for |
done.
|
the |
Summary
related to PR: encode/httpx#2997
Checklist