无法通过代理发出请求 python3

Can't make requests by proxies python3

我正在尝试使用代理发出请求,但我不知道为什么


loadproxy = {
    "https":"114.99.11.114:3000",
    "http":"114.99.11.114:3000",
}

url = "http://httpbin.org/ip"

res = requests.get(url,proxies=loadproxy)


print(res.text)



文件“/usr/lib/python3/dist-packages/requests/adapters.py”,第 502 行,正在发送 提高 ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPConnectionPool(host='114.99.11.114', port=3000): 最大重试次数超过 url: http://httpbin.org/ip (由 ProxyError('Cannot connect to proxy.', NewConnectionError(' : 建立新连接失败: [Errno 110] 连接超时',)))

我不知道为什么它可以正常工作,但代理无法正常工作,但我已经更改了很多代理寻求帮助

还有一个要补充的是,当我更改代理时,我更改了它,我的代码看起来很漂亮

loadproxy = {
    "https":"118.69.50.154:80",
    "http":"118.69.50.154:80",
}

url = "http://httpbin.org/ip"

res = requests.get(url,proxies=loadproxy)


print(res.text)


但这里的问题是它显示了我的原始 ip

{ "origin": "my_ip" }

甚至代理也是匿名的

print(requests.get("http://httpbin.org/ip",proxies={"http":"http://118.69.50.154:80"}).text)

为我工作并制作了:

{
    "origin": "210.245.110.254"  
}

绝对不是我的IP