#Help, this is my first time using workers.

24 messages · Page 1 of 1 (latest)

ebon orchid
#

for example how do I set up my my cloudflare worker to run through a proxy

fair cipher
#

Like locally or remotely?

ebon orchid
#

which is better

fair cipher
#

You can't run a worker via a proxy when it is deployed.

ebon orchid
#

I want my worker to use a proxy to fetch requests

fair cipher
#

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

ebon orchid
#
  const proxyOptions = {
    cf: {
      resolveOverride: proxyUrl
    }
  }

  const response = await fetch('', proxyOptions);```

I tried this
fair cipher
#

That only does the DNS

ebon orchid
fair cipher
#

Why are you looking to use a proxy for your fetch requests?

ebon orchid
#

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

fair cipher
#

You can try the agent part of the fetch request but otherwise it isn't going to be possible

ebon orchid
#

why not

#

so you cant directly route the HTTP request through the specified proxy server in cloudflare?

#

how should I make my program then

fair cipher
#

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.

ebon orchid
#

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