diff --git a/CHANGES/8920.misc.rst b/CHANGES/8920.misc.rst new file mode 100644 index 00000000000..2e8640593a4 --- /dev/null +++ b/CHANGES/8920.misc.rst @@ -0,0 +1 @@ +Enabled keep-alive support on proxies (which was originally disabled several years ago) -- by :user:`Dreamsorcerer`. diff --git a/aiohttp/client_proto.py b/aiohttp/client_proto.py index d42591e86f5..6765aaf0eba 100644 --- a/aiohttp/client_proto.py +++ b/aiohttp/client_proto.py @@ -66,9 +66,6 @@ def should_close(self) -> bool: or bool(self._tail) ) - def force_close(self) -> None: - self._should_close = True - def close(self) -> None: transport = self.transport if transport is not None: diff --git a/aiohttp/connector.py b/aiohttp/connector.py index e4a0b98b2df..3438d600ded 100644 --- a/aiohttp/connector.py +++ b/aiohttp/connector.py @@ -1284,11 +1284,6 @@ async def _create_proxy_connection( proxy_req, [], timeout, client_error=ClientProxyConnectionError ) - # Many HTTP proxies has buggy keepalive support. Let's not - # reuse connection but close it after processing every - # response. - proto.force_close() - auth = proxy_req.headers.pop(hdrs.AUTHORIZATION, None) if auth is not None: if not req.is_ssl():