I have an AWS Lambda feature that needs to connect to the internal website that is behind the proxy server. In my code, I do the following:
from botocore.vendored import requests
https_proxy = "https://myproxy:myport"
proxyDict = {
"https" : https_proxy
}
request.get("https://myurl.json", proxies=proxyDict)
Running this causes the following error message:
HTTPSConnectionPool (host = 'myproxyhost', port = 443): Maximum number of attempts exceeded with url: myurl.json (caused by ProxyError ('Cannot connect to proxy.', Gaierror (-2, 'Name or service unknown')))
I tried replacing the proxy address with google.com to confirm that I can connect to other sites (without a proxy).
It looks like the address space that Lambda launches is blocked by the proxy.
Is there anything else I need to ask with queries and lambda to make this work?