cloud-sql-python-connector icon indicating copy to clipboard operation
cloud-sql-python-connector copied to clipboard

Add support for ALL_PROXY and HTTP_PROXY

Open enocom opened this issue 1 year ago • 1 comments

Feature Description

This is a simple change as described here: https://docs.aiohttp.org/en/stable/client_advanced.html?highlight=proxy#proxy-support.

Customers should have to opt-in to this behavior to prevent any unwanted security issues.

Sample code

No response

Alternatives Considered

No response

Additional Details

No response

enocom avatar Mar 16 '23 21:03 enocom

Notes: aiohttp.ClientSession object does not natively support socks proxies when using trust_env

async with aiohttp.ClientSession(trust_env=True) as session:

Third-party libs such as aiohttp-socks allow for adding support of socks proxy to aiohttp.ClientSession.

I looked at ability to pass in a custom ClientSession object into Connector() initialization as we do not want to depend on third party library such as aiohttp-socks. Issues arise for sync drivers as custom client session belong to different event loop than the one Connector spins up in the background.

Will re-investigate this issue if it gains traction here.

jackwotherspoon avatar Apr 03 '23 15:04 jackwotherspoon