XenoX
Apify & Crawlee11mo ago
4 replies
Xeno

Proxy Support

Is this the right away to add proxy support to an Actor? I'm guessing this is using the datacenter proxies included in my plan? Would users would be able to buy their own proxies and it would work? Or does the groups need to somehow get the proxy group name they purchased?

            proxy_configuration = await Actor.create_proxy_configuration(
                groups=['BUYPROXIES94952'],
                country_code='US'
            )
            proxy_url = await proxy_configuration.new_url()
            Actor.log.info(f'Using proxy URL: {proxy_url}')

            async with AsyncClient(timeout=30.0) as client:
                transport = client._transport  
                transport.proxies = {'http': proxy_url, 'https': proxy_url}  
Was this page helpful?