我有一个虚拟服务器,有2个IP地址。我编写了一个python脚本来发送HTTP请求(通过使用
requests
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,
)
默认情况下,它使用服务器的主IP发送请求。如何通过服务器的第二个IP发送请求?