Is there a way to prevent the Python requests from connecting to a proxy server

41 Views Asked by At

At work we must go through a proxy server to get out to the internet.

I am trying to use requests to get a response from an internal server and I do not need go through the proxy.

requests tries to go through the proxy and gets rejected.

ProxyError: HTTPConnectionPool(host='127.0.0.1', port=3128): Max retries exceeded with url: http://hiacissimptest.impgroup.com/sumdata/summary_report/ (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002306F0095D0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))

When I have configured proxy server access for my browser or PyCharm, there is a setting to tell the app that it does not need to go through the proxy for local addresses. Is there a similar setting for requests, I can't seem to find one.

0

There are 0 best solutions below