Skip to content

Instantly share code, notes, and snippets.

@tacahiroy
Created November 5, 2020 05:25
Show Gist options
  • Save tacahiroy/9747823051490e45381bc92f8daa9858 to your computer and use it in GitHub Desktop.
Save tacahiroy/9747823051490e45381bc92f8daa9858 to your computer and use it in GitHub Desktop.
Get something using HTTPS with Basic auth via SOCKS5 proxy in Python 3.x
import sys
import requests
if __name__ == "__main__":
res = requests.get(
"https://foo.local/",
auth=("user", "password"),
proxies={
"http": "socks5h://host:port",
"https": "socks5h://host:port",
},
)
print(res.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment