Skip to content

feat(crawlers)!: Introduce a protocol for ProxyConfiguration - #2582

Draft
Mantisus wants to merge 3 commits into
apify:v2from
Mantisus:proxy-configuration-protocol
Draft

Mantisus wants to merge 3 commits into
apify:v2from
Mantisus:proxy-configuration-protocol

Conversation

@Mantisus

@Mantisus Mantisus commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The proxy_configuration option of the crawlers and of SessionPool takes any proxy configuration implementation: an object with an async new_proxy_info(proxy_info) method, which gets the saved proxy of a restored session and returns the proxy of the session, or None for no proxy. BasicCrawlerOptions.proxy_configuration is typed by this method, so other ProxyConfiguration methods, such as new_url(), need a cast.

The session pool uses a passed proxy configuration even when it's falsy, and its warning about dropped restored sessions points to a configuration that restores the passwords.

Issues

Testing

  • Unit test for a falsy proxy configuration. The session pool tests mock the protocol.

✍️ Drafted by Claude Code

@Mantisus Mantisus self-assigned this Dec 3, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Dec 3, 2026
@Mantisus Mantisus changed the title Proxy configuration protocol feat(crawlers)!: Introduce a protocol for ProxyConfiguration Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant