GoogleCloudPlatform / cloud-sql-jdbc-socket-factory

A collection of Java libraries for connecting securely to Cloud SQL
Apache License 2.0
226 stars 120 forks source link

Capability to forward traffic to a socks5 proxy #1242

Open hanknac opened 1 year ago

hanknac commented 1 year ago

Feature Description

In scenarios (e.g. transitive vpc problem) that require the java sql connector to forward traffic to a socks5 proxy, it would great if this capability could be added to the java sql connector. Similar to the way the sql auth proxy can forward traffic to a socsk5 proxy by setting the ALL_PROXY environment variable, ideally the java sql connector would behave in the same manner.

Sample code

No response

Alternatives Considered

The workaround is to install the sql auth proxy locally with the application, so the sql auth proxy could forward traffic to the socks5 proxy. This is not ideal because the. sql auth proxy would need to be installed, configured, and started on every developer's computer.

Additional Details

No response

enocom commented 1 year ago

To support this, we'd need to let callers configure the HTTP Transport and the socket to use a socks5 proxy. Do-able, but requires investigation as Java doesn't support this as easily as Go.