Skip to content

Instantly share code, notes, and snippets.

@fmasanori
Created July 3, 2015 13:41
Show Gist options
  • Save fmasanori/24053cd6ac62da786c10 to your computer and use it in GitHub Desktop.
Save fmasanori/24053cd6ac62da786c10 to your computer and use it in GitHub Desktop.
Set HTTP_PROXY
import urllib.request as req
proxy = req.ProxyHandler({'http': r'http://user:password@ip:port'})
auth = req.HTTPBasicAuthHandler()
opener = req.build_opener(proxy, auth, req.HTTPHandler)
req.install_opener(opener)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment