I have a virtual server that has 2 IP addresses. I wrote a python script that sends HTTP request (by using requests library). the script is the following:
import requests
headers = {
'User-agent': 'Mozilla/5.0',
'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip'
}
url = 'https://www.google.com'
request_no_proxy = requests.get(
url,
headers=headers,
)
by default, it sends the request with primary IP of the server. how can I send request by second IP of the server?