I have the code below, that sets a proxy for a file download process.
How do I add a user/password (only using packages that come by default with python) ?
from http.client import HTTPResponse
from urllib import request, error
def setup_opener():
if proxy:
proxy_handler = request.ProxyHandler({proxy.protocol: proxy.host})
auth = request.HTTPBasicAuthHandler()
opener = request.build_opener(proxy_handler, auth, request.HTTPHandler)
request.install_opener(opener)
setup_opener()