-
Notifications
You must be signed in to change notification settings - Fork 3
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
Proxy support? #3
Comments
That's weird. Did you make any other changes? Maybe the HEAD request is being sent directly (i.e, without proxy). I wasn't able to get import requests
import requests_toolbelt
proxies = {'http': 'socks5://host:port'}
requests.head('http://example.org', proxies=proxies) # works with proxy
s = requests.Session()
s.mount('http://', requests_toolbelt.SourceAddressAdapter(local_ip))
s.head('http://example.org') # works without proxy
s.head('http://example.org', proxies=proxies) # raises exception |
Yeah both are working fine... Did you install the dependency - requests[socks]? BTW I've also installed pysocks this may be the issue |
I did. Btw, I had (have?) the same problem with a local HTTP proxy server. Anyway, the error I'm facing is OSError: [WinError 10049] The requested address is not valid in its context which seems to be Windows-specific and possibly has something to do with local proxy servers I'm running. Are you using an external proxy server? |
No its a local socks proxy created by ssh tunnel(to my vps) Even I tried with my windows machine and I'm getting [WinError xxxx] for both http and socks proxy but strangely https proxy works fine!!! |
See if your proxy server is ignoring or otherwise somehow messing up range headers -- that's the only difference I can think of. Given those simple proxy requests are failing for me, there's nothing much I can do to help. |
I don't think its possible as firewall blocks almost every port(except 22). So any connection bypassing proxy wont go through the firewall.(Using proxy is the only way to access internet) |
You seem to have misunderstood me. I'm not saying your proxy server is bypassed. |
If thats the case it should never download anything, right? But when when i use the script (with same proxy) with my mobile data connection its downloading the file. Let me know if I missed something |
Oh. I can't think of anything else that would cause the problem. |
Okk , So probably a bug in requests? |
Um, probably not. I mean it's not impossible but chances are, something is wrong on our end; a bug in requests_toolbelt; a bug in requests, in that order. |
So no solutions for now, huh? BTW do you have plans of making a gui or something? |
I did at one point but later decided I just don't need it. |
Bored with the copy - pasting the url, I'm planning to make a browser extension(aria2c style) :p Any suggestions over aria2c? |
I somehow missed your last comment. How is it coming along? |
Haven't started it, yet. Broke my mobile firmware and had to spend almost a week on that + midsems are just a few days away :( .Will start after next week.. |
I tried to add proxy by editing sessionpool.py(L59) following this but when i run the script it would fetch the meta-data of the file but wouldn't download it(stuck at 0%)
Any ideas @avamsi ?
The text was updated successfully, but these errors were encountered: