Skip to content

shouldn env_proxy affect after proxy that provided by users from code #10025

Open
@NewUserHa

Description

@NewUserHa

Is your feature request related to a problem?

aiohttp/aiohttp/client.py

Lines 502 to 507 in e79b2d5

if proxy is None:
proxy = self._default_proxy
if proxy_auth is None:
proxy_auth = self._default_proxy_auth

aiohttp/aiohttp/client.py

Lines 609 to 617 in e79b2d5

if proxy is not None:
proxy = URL(proxy)
elif self._trust_env:
with suppress(LookupError):
proxy, proxy_auth = get_env_proxy_for_url(url)
req = self._request_class(
method,

currently, the async def _request(...)

  • uses proxy from env first than from code
  • it at the same time causes calling get env proxy from env and registry in each request(aka _request()) call.

Describe the solution you'd like

keep env proxy in session, and use after code proxy that provided by users
also should throw error for socks5 proxy since aiohttp does not work with socks5 currently

Describe alternatives you've considered

N/A

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions