Skip to content

Instantly share code, notes, and snippets.

View beugley's full-sized avatar

Brian Eugley beugley

View GitHub Profile
@beugley
beugley / httplib_proxy.py
Last active June 3, 2025 19:57
Python: use httplib with proxy authentication
import urlparse
import httplib
import base64
proxy_uri = "http://user:password@proxy_host:proxy_port"
host = 'www.google.com'
port = 443
url = urlparse.urlparse(proxy_uri)
conn = httplib.HTTPSConnection(url.hostname, url.port)