Advertisement
dereksir

Untitled

Oct 2nd, 2023 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import urllib3
  2.  
  3. # Build headers for the basic_auth component
  4. auth_creds = urllib3.util.make_headers(proxy_basic_auth="username:password")
  5.  
  6. # Create a Proxy Manager for managing proxy servers
  7. proxy = urllib3.ProxyManager("http://75.89.101.60:80", proxy_headers=auth_creds)
  8.  
  9. # Make GET request through the proxy
  10. response = proxy.request("GET", "http://httpbin.io/ip")
  11.  
  12. #Print the returned data
  13. print(response.data)
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement