From ec14742c2208bafb2b49bf00f3cc616d611c82e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ad=C3=A1mek?= Date: Tue, 1 Dec 2026 17:19:11 +0100 Subject: [PATCH] docs: Stop logging generated proxy URLs in proxy examples The examples now pass the URL on or show its expected value in a comment instead of printing it, since Apify Proxy URLs include the proxy password. --- docs/02_concepts/code/05_apify_proxy.py | 2 +- docs/02_concepts/code/05_apify_proxy_config.py | 2 +- docs/02_concepts/code/05_custom_proxy.py | 3 +-- docs/02_concepts/code/05_custom_proxy_function.py | 4 ++-- docs/02_concepts/code/05_proxy_actor_input.py | 2 +- docs/02_concepts/code/05_tiered_proxy.py | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/02_concepts/code/05_apify_proxy.py b/docs/02_concepts/code/05_apify_proxy.py index 902ec1f74..43e3f8440 100644 --- a/docs/02_concepts/code/05_apify_proxy.py +++ b/docs/02_concepts/code/05_apify_proxy.py @@ -12,7 +12,7 @@ async def main() -> None: return proxy_url = await proxy_cfg.new_url() - Actor.log.info(f'Using proxy URL: {proxy_url}') + # The URL includes the proxy password. Pass it to your HTTP client, don't log it. if __name__ == '__main__': diff --git a/docs/02_concepts/code/05_apify_proxy_config.py b/docs/02_concepts/code/05_apify_proxy_config.py index 948c0fd79..e5f1b0cdf 100644 --- a/docs/02_concepts/code/05_apify_proxy_config.py +++ b/docs/02_concepts/code/05_apify_proxy_config.py @@ -16,7 +16,7 @@ async def main() -> None: return proxy_url = await proxy_cfg.new_url() - Actor.log.info(f'Proxy URL: {proxy_url}') + # The URL includes the proxy password. Pass it to your HTTP client, don't log it. if __name__ == '__main__': diff --git a/docs/02_concepts/code/05_custom_proxy.py b/docs/02_concepts/code/05_custom_proxy.py index 43ad2dbfe..ec1d47fca 100644 --- a/docs/02_concepts/code/05_custom_proxy.py +++ b/docs/02_concepts/code/05_custom_proxy.py @@ -15,8 +15,7 @@ async def main() -> None: if not proxy_cfg: raise RuntimeError('No proxy configuration available.') - proxy_url = await proxy_cfg.new_url() - Actor.log.info(f'Using proxy URL: {proxy_url}') + proxy_url = await proxy_cfg.new_url() # http://proxy-1.com if __name__ == '__main__': diff --git a/docs/02_concepts/code/05_custom_proxy_function.py b/docs/02_concepts/code/05_custom_proxy_function.py index 41ca5ccc4..e2512cb1e 100644 --- a/docs/02_concepts/code/05_custom_proxy_function.py +++ b/docs/02_concepts/code/05_custom_proxy_function.py @@ -26,11 +26,11 @@ async def main() -> None: if not proxy_cfg: raise RuntimeError('No proxy configuration available.') + # http://my-custom-proxy-supporting-sessions.com/?session-id=a proxy_url_with_session = await proxy_cfg.new_url('a') - Actor.log.info(f'Using proxy URL: {proxy_url_with_session}') + # http://my-custom-proxy-not-supporting-sessions.com proxy_url_without_session = await proxy_cfg.new_url() - Actor.log.info(f'Using proxy URL: {proxy_url_without_session}') if __name__ == '__main__': diff --git a/docs/02_concepts/code/05_proxy_actor_input.py b/docs/02_concepts/code/05_proxy_actor_input.py index adf0d8d32..4b87f07e4 100644 --- a/docs/02_concepts/code/05_proxy_actor_input.py +++ b/docs/02_concepts/code/05_proxy_actor_input.py @@ -15,7 +15,7 @@ async def main() -> None: raise RuntimeError('No proxy configuration available.') proxy_url = await proxy_cfg.new_url() - Actor.log.info(f'Using proxy URL: {proxy_url}') + # The URL includes the proxy password. Pass it to your HTTP client, don't log it. if __name__ == '__main__': diff --git a/docs/02_concepts/code/05_tiered_proxy.py b/docs/02_concepts/code/05_tiered_proxy.py index 7e98f1d61..57ee78399 100644 --- a/docs/02_concepts/code/05_tiered_proxy.py +++ b/docs/02_concepts/code/05_tiered_proxy.py @@ -19,7 +19,7 @@ async def main() -> None: await proxy_configuration.initialize() proxy_url = await proxy_configuration.new_url() - Actor.log.info(f'Using proxy URL: {proxy_url}') + # Pass the URL to your HTTP client. if __name__ == '__main__':