Connecting to Asana with Python Through a Proxy

Hello, I’m trying to write a Python script to connect to Asana. I’ve run the Hello World script on my company laptop and it works perfectly when not signed into the company VPN. However, once I connect to VPN, it hangs, likely due to the need to use a proxy. I’ve tried setting the http_proxy/https_proxy environment variables, but it still hangs. I see an example of setting the proxies in a session structure, but how do I pass it to the call to ApiClient? I cannot find any examples or anything in the docs.

Thanks,

Jim

Have you tries reading the source of the python client? and possibly ask AI for help?

Bastien, good suggestion. I finally found the source and see the Connection object has a proxy field, which did the trick. For documentation for others, this is what I added…

onfiguration = asana.Configuration()
configuration.access_token = ‘’
configuration.proxy=“<>”
api_client = asana.ApiClient(configuration)

2 Likes

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