Skip to content

Instantly share code, notes, and snippets.

@socrateslee
Created March 26, 2013 05:31
Show Gist options
  • Save socrateslee/5243365 to your computer and use it in GitHub Desktop.
Save socrateslee/5243365 to your computer and use it in GitHub Desktop.
Set remote dns for httplib2 proxy.
import httplib2
# set proxy_rdns=True to ensure use the dns on
# remote proxy, in case local DNS is pulluted.
proxy = httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_HTTP,
'localhost', 8000,
proxy_rdns=True)
http = httplib2.Http(proxy_info=proxy)
http.request('http://google.com')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment