CloudFlare Python Module

Hello,
Our team is using a Cloudflare python module to automate dashboard information retrieval that can be found here ( GitHub - cloudflare/python-cloudflare: Python wrapper for the Cloudflare Client API v4 ).After going through the code and documentation, we were not able to find a way to configure a proxy setting to authenticate through our corporate proxy server.

Has anyone experienced this scenario and found a solution?

Simple Example using email and global key to connect
#!/usr/bin/env python
import Cloudflare
def main():
cf = Cloudflare.Cloudflare(auth_email,global_key)
zones = cf.zones.get(params={‘per_page’:50})
for zone in zones:
zone_name = zone[‘name’]
zone_id = zone[‘id’]
settings_ipv6 = cf.zones.settings.ipv6.get(zone_id)
ipv6_on = settings_ipv6[‘value’]
print zone_id, ipv6_on, zone_name
exit(0)
if name == ‘main’:
main()

An error is generated after a timeout due to not authenticating with the corporate proxy.
Cloudflare.exceptions.CloudFlareAPIError: HTTPSConnectionPool(host=‘api.cloudflare.com’, port=443): Max retries exceeded with url: /client/v4/zones?per_page=50 (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x6fffff6968d0>: Failed to establish a new connection: [Errno 114] Network is unreachable’))

Thanks

It does not appear that the python client library supports proxy settings, so you will be unable to use it while doing the proxy settings. You should make an issue on the repo to request it.

Thanks for the information. Much appreciated. :smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.