Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Using Boto with SOCKS5 #880

Closed
cjhanks opened this issue Apr 13, 2016 · 7 comments
Closed

Question: Using Boto with SOCKS5 #880

cjhanks opened this issue Apr 13, 2016 · 7 comments
Labels
closed-for-staleness feature-request This issue requests a feature.

Comments

@cjhanks
Copy link

cjhanks commented Apr 13, 2016

Are there any integration points/configuration parameters to use botocore with a SOCKS5 proxy? That would include routing DNS requests through the proxy.

@kyleknap
Copy link
Contributor

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.

@kyleknap kyleknap added feature-request This issue requests a feature. blocked labels Apr 15, 2016
@joshuadfranklin
Copy link

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])

@kyleknap
Copy link
Contributor

kyleknap commented May 4, 2016

Cool. So now all we will need to do is switch dependency of requests to 2.10.0 now to pick up support.

@rlukin
Copy link

rlukin commented Jul 24, 2018

@kyleknap is it going to be done?

@ugtar
Copy link

ugtar commented Nov 13, 2019

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?

@apyrgio
Copy link

apyrgio commented May 29, 2020

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:

def _fix_proxy_url(self, proxy_url):
if proxy_url.startswith('http:') or proxy_url.startswith('https:'):
return proxy_url
elif proxy_url.startswith('//'):
return 'http:' + proxy_url
else:
return 'http://' + proxy_url

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?

dbevacqua added a commit to treatwell/botocore that referenced this issue Jun 17, 2020
dbevacqua added a commit to treatwell/botocore that referenced this issue Jun 17, 2020
dbevacqua added a commit to treatwell/botocore that referenced this issue Jun 18, 2020
hnousiainen pushed a commit to aiven/botocore that referenced this issue Apr 20, 2021
hnousiainen pushed a commit to aiven/botocore that referenced this issue Apr 20, 2021
hnousiainen pushed a commit to aiven/botocore that referenced this issue Apr 20, 2021
hnousiainen pushed a commit to aiven/botocore that referenced this issue Apr 20, 2021
vkantchev added a commit to vkantchev/botocore that referenced this issue Jun 14, 2021
sjamgade pushed a commit to aiven/botocore that referenced this issue Aug 3, 2021
sjamgade pushed a commit to aiven/botocore that referenced this issue Aug 3, 2021
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness feature-request This issue requests a feature.
Projects
None yet
Development

No branches or pull requests

6 participants