Proxies

The ThreatConnect TcEx App Framework provides the proxies property to automatically create a dictionary with the properly formatted proxy settings used by the Python Requests module.

Note

When using the tcex_resources() module or session property, the proxies are automatically configured.

Hint

The proxies property can be helpful when using the TcExRequest module.

Example Request using Proxy

1r = tcex.request
2if args.tc_proxy_external:
3    r.proxies = tcex.proxies
4r.url = 'https://remote_api.example'
5r.add_payload('api_key', 'abc123')
6response = r.send()