首先,我使用python代码是可以使用这个代理的
这个代理是ss,当然,我工作上用的是一些更复杂的代理
import requests
r = requests.get('https://ipapi.co/json/',
proxies={'all':'http://127.0.0.1:1080'},verify=False)
print(r.text)
然后我把代理调整为anyproxy,尝试让请求到anyproxy后再走代理
import requests
r = requests.get('https://ipapi.co/json/',
proxies={'all':'http://127.0.0.1:8888'},verify=False)
print(r.text)
print(r.status_code)
module.exports = {
* beforeSendRequest(requestDetail) {
const newRequestOptions = requestDetail.requestOptions;
// 设置属性 rejectUnauthorized 为 false
newRequestOptions.rejectUnauthorized = false;
newRequestOptions.path = requestDetail.url;
requestDetail.protocol = 'http';
newRequestOptions.hostname = '127.0.0.1';
newRequestOptions.port = '1080';
return requestDetail;
},
};
结果python这边返回的是
C:\Users\wplct\PycharmProjects\myProxy\venv\lib\site-packages\urllib3\connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
200
没有返回值,我对nodejs没什么了解。希望路过的大佬可以帮忙看看
麻烦了
1条答案
按热度按时间jpfvwuh41#
这是response