So far, we have seen clients directly connecting and talking to the server. Using proxy, the interaction happens as follows −
Using Http-proxy is additional security assigned to manage the data exchange between client and server. The requests libraries also have provision to handle proxy, by using the proxies param as shown below −
import requests proxies = { 'http': 'http://localhost:8080' } res = requests.get('http://httpbin.org/', proxies=proxies) print(res.status_code)
The request will route to http://localhost:8080 URL.
200