cloud-sql-python-connector
cloud-sql-python-connector copied to clipboard
Add support for ALL_PROXY and HTTP_PROXY
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
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.