proxy - Cant seem to get https and socks proxies to work using python requests -


so i'm looking @ traffic using wireshark , comparing output number of situations. i'm looking @ traffic between me , google.co.za.

situation 1: accessing google.co.za using no proxy

requests.get('www.google.co.za') 

this returns response status=200 , wireshark displays info traffic passing between pc , google's servers. great far.

situation 2: accessing google.co.za using valid http proxy

requests.get("http://google.co.za",proxies={'http':proxy}) 

this returns response status=200 , wireshark displays no data traffic passing between pc , google's servers. great , expected , stuff.

situation 3: accessing google.co.za using valid socks proxy

requests.get("http://google.co.za",proxies={'socks':proxy}) 

result per situation 1. hmmm

situation 4: same deal https

requests.get("http://google.co.za",proxies={'https':proxy}) 

same result situation 1.

question

so looks when try use https , socks proxies requests acts though proxy argument empty. need pass traffic through sorts of proxies , don't want silent failures.

my question is: why stuff failing silently , can fix it?

requests not yet support either socks or https proxies.

they're working in it, though. see here: https://github.com/kennethreitz/requests/pull/1515

support https proxies has been merged requests 2.0 branch, if can try version; wary though, it unstable branch.

socks proxy support, on other hand, still being worked on in lower-level library, urllib3: https://github.com/shazow/urllib3/pull/68

also, regardless of that, using proxies argument incorrectly. should of form {protocol_of_sites_you_visit: proxy}, once support complete, using socks5 proxy more along lines of {"http": "socks5://127.0.0.1:9050"}.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -