#Help, this is my first time using workers.
24 messages · Page 1 of 1 (latest)
Like locally or remotely?
which is better
You can't run a worker via a proxy when it is deployed.
I want my worker to use a proxy to fetch requests
I mean you can have your worker make a request to your proxy which then makes the request but you can't configure something like an HTTP proxy for a worker
const proxyOptions = {
cf: {
resolveOverride: proxyUrl
}
}
const response = await fetch('', proxyOptions);```
I tried this
That only does the DNS

You could try something like https://github.com/TooTallNate/proxy-agents/tree/main/packages/https-proxy-agent
Why are you looking to use a proxy for your fetch requests?
I'm making an API that will receive user input and then send X number of requests based on their input to another API endpoint with fetch post
but I don't want to get ratelimited so I want to use a rotating proxy for each fetch
infact I have already made that program in python I just don't have the knowledge to turn it into a javascript cloudlfare worker
You can try the agent part of the fetch request but otherwise it isn't going to be possible
why not
so you cant directly route the HTTP request through the specified proxy server in cloudflare?
how should I make my program then
Because there isn't another way to have node use a HTTP proxy. You can make your worker make a request to another program which has the proxy information.
okay what if
I host my own api from my PC
then I can use proxies
I can use the cloudflare worker to handle incoming requests and send them to my PC which will act like an API endpoint and receive requests while being hidden in the worker so that way it can't be accessed outside it and my IP is protected
because I don't know any cloud VM hosting providers that allow the using of proxies