Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tieredProxyUrls accept null for switching the proxy off #2743

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

barjin
Copy link
Contributor

@barjin barjin commented Nov 12, 2024

Since #2392, the ProxyConfiguration class is ready for null proxy "URLs" - this means that the proxy won't be used.

This already worked with newUrlFunction, but because of types and validation, users couldn't use it with tieredProxyUrls.

This PR relaxes the type checks and validation so we can use stuff like:

new ProxyConfiguration({
    tieredProxyUrls: [
        [null], 
        ['http://proxy.apify.com', 'http://some.other.proxy.com']
    ],
})

and even

new ProxyConfiguration({
    tieredProxyUrls: [
-       [null], 
+       [null, 'http://some.local.cheap.proxy', 'http://other.local.cheap.proxy'], 
        ['http://proxy.apify.com', 'http://some.other.proxy.com']
    ],
})

Closes #2740

@barjin barjin requested a review from janbuchar November 12, 2024 09:55
@barjin barjin self-assigned this Nov 12, 2024
@github-actions github-actions bot added this to the 102nd sprint - Tooling team milestone Nov 12, 2024
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 12, 2024
@barjin barjin requested a review from B4nan November 12, 2024 09:57
@janbuchar
Copy link
Contributor

Seems OK! Could you make an issue for porting this to crawlee-python please?

@barjin
Copy link
Contributor Author

barjin commented Nov 12, 2024

Here you go:

apify/crawlee-python#687

@barjin barjin merged commit 82f4ea9 into master Nov 12, 2024
10 checks passed
@barjin barjin deleted the feat/tiered-proxies-null branch November 12, 2024 11:50
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.

Add ability to start with "no proxy"
3 participants