Are there any integration points/configuration parameters to use botocore with a SOCKS5 proxy? That would include routing DNS requests through the proxy.
So botocore does not support SOCKS5 as we use requests under the hood for our http library, and it looks like it is not supported yet. The good news is it looks like it is going to be supported soon: https://github.com/kennethreitz/requests/pull/2953. So once that gets merged and out in a release, we will need to vendor that new version of requests.
As to current interfaces, the best way to set the proxy in botocore is by using the HTTPS_PROXY and HTTP_PROXY environment variables but as of now you will get a error message Not supported proxy scheme socks5. So marking this as blocked feature request.
FYI requests 2.10.0 (2016-04-29) includes it:
https://github.com/kennethreitz/requests/blob/master/HISTORY.rst#2100-2016-04-29
SOCKS Proxy Support! (requires PySocks; $ pip install requests[socks])
Cool. So now all we will need to do is switch dependency of requests to 2.10.0 now to pick up support.
@kyleknap is it going to be done?
I see the requests was recently un-vendored (#1829). Does this mean that boto3 will use the default requests library from the environment? What does this mean in terms of socks proxy support in boto3? Will we be able to use a socks proxy assuming the version of requests we have installed supports it?
We've stumbled on this recently as well. It seems that currently there is code that handles HTTP/HTTPS proxies, but not SOCKS proxies. For example, see:
As you see, this code does not check if a different/wrong URI scheme has been provided. This means that if one naively provides a SOCKS URI, they will see this misleading error:
Failed to connect to proxy URL: "http://socks5://localhost:port"
Are there any plans to fix this?
Most helpful comment
We've stumbled on this recently as well. It seems that currently there is code that handles HTTP/HTTPS proxies, but not SOCKS proxies. For example, see:
https://github.com/boto/botocore/blob/f71d67a1cd77c4e77caad583c0e2bc057d0acd84/botocore/httpsession.py#L116-L122
As you see, this code does not check if a different/wrong URI scheme has been provided. This means that if one naively provides a SOCKS URI, they will see this misleading error:
Are there any plans to fix this?