Skip to content

sendRequest does not use custom proxies #2917

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

Open
1 task
tugkan opened this issue Apr 7, 2025 · 3 comments
Open
1 task

sendRequest does not use custom proxies #2917

tugkan opened this issue Apr 7, 2025 · 3 comments
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.
Milestone

Comments

@tugkan
Copy link

tugkan commented Apr 7, 2025

Which package is this bug report for? If unsure which one to select, leave blank

@crawlee/basic (BasicCrawler)

Issue description

If you use the custom proxies like this:

{
   "proxy": {
      "useApifyProxy": false,
      "proxyUrls": [ "https://..." ]
   }
}

The proxyInfo object is not exposed to CrawlerContext. Therefore, sendRequest dispatches requests from naked IPs.

I am not quite sure if this is expected behavior or not. Just wanted to reach out.

Code sample

https://github.com/apify/crawlee/blob/764f99203627b6a44d2ee90d623b8b0e6ecbffb5/packages/basic-crawler/src/internals/basic-crawler.ts#L1419

Package version

3.13.1

Node.js version

22

Operating system

No response

Apify platform

  • Tick me if you encountered this issue on the Apify platform

I have tested this on the next release

No response

Other context

No response

@tugkan tugkan added the bug Something isn't working. label Apr 7, 2025
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Apr 7, 2025
@B4nan B4nan pinned this issue Apr 8, 2025
@B4nan B4nan unpinned this issue Apr 8, 2025
@B4nan
Copy link
Member

B4nan commented Apr 8, 2025

There is no proxy on BasicCrawler level, this is expected behavior.

https://crawlee.dev/js/api/basic-crawler/interface/BasicCrawlerOptions

Expected, but I also get confused by this quite often. Maybe we should rework this.

@janbuchar
Copy link
Contributor

I guess there's no harm in pulling ProxyInfo all the way to BasicCrawler, is there? Even if there's some use case for BasicCrawler where proxies don't make any sense, the overhead of keeping a ProxyInfo for each run of the request handler should be negligible.

@B4nan
Copy link
Member

B4nan commented Apr 8, 2025

Yeah, I would be for moving the proxyConfiguration option to the basic crawler level too, it kinda makes sense if we tell people to use sendRequest to have a native support for proxies on that level.

@B4nan B4nan added this to the 4.0 milestone Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

3 participants