Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

Using WAF to block Traffic

Hello, We use workers to host our site. Over the past few weeks we noticed some major attacks on our API. We thought it was on the API direct, but turns out after watching the Stream Logs, that we have some people able to bypass Cloudflare protections on the website using crawling tools. We use a subdomain company.workers.dev. However, I this links to our CNAME for our company.com website. I am inside our company.com website WAF settings and attempting to block a few subset of IPs from our workers.dev account page.
How or why is the block not occuring? What light switch am I missing?...

Unknown error 10013

```Error on remote worker: APIError: A request to the Cloudflare API (/accounts/3ee55606f881222ad1efb703537713b1/workers/scripts/backoffice/edge-preview) failed. at throwFetchError (/node_modules/wrangler/wrangler-dist/cli.js:122866:18) at fetchResult...

D1 storage operation exceeded timeout which caused object to be reset

Many people say that this error occurs rarely when operating d1. I am one of them. Is there anything we can do about it, or do we just have to wait for the administrators to fix it? If there are any alternative plans, please let us know....

rate limiting issues

Hi Im using the cloudflare rate limiting beta, and it works fine when I make my requests through the browser. When I make requests through my local API client (bruno) it seems to have no effect and will never rate limit the user even if they exceed the threshold. Don't really understand why....

upload_source_maps=true is not working

I made a Hono API, and when I log the error in my logging middleware it doesn't show the original file location. It look like: ```typescript Error: test...

Cloudflare #Workers possible #CRON #bug ? worker being called tens of times

Hi, Context worker script: - a) not using CLI; but web interface to copy/paste updated script, debug using console...
No description

socket.writable.getWriter().write() hangs at 7th write

hello, i have a Cloudflare Workers to act like a "server ping service" using cloudflare:sockets. Below is my code for pinging an IP address using sockets, with amount time, and server is the WebSockets Server connected to client for sending back the ping data: ```js const pingServer = async () => { for (let i = 0; i < amount; i++) { try {...
No description

Can i handle cache in dashboard?

Is it possible to view the list of cached keys in the Cloudflare Workers cache api and purge specific keys from the dashboard via GUI?

Queue consumer from nextjs worker

I'm trying to figure out what the project structure would look like if you're using the nextjs framework and you're deploying to workers. Supposedly, worker nextjs should support effectively all services (creating durable objects, workflows, service bindings). But where would all of those worker specific files be located? They wouldn't be in the app/api/[route] for nextjs backend routes. Do people just make a seperate folder at the root for all "worker functions"? Any examples people can point to?...

Cloudflare Worker Cron Trigger

By simply following this tutorial https://developers.cloudflare.com/workers/examples/cron-trigger/ seems like a failure to me, I dont get what I am expecting to get from the tutorial

OAuth token request works locally but fails in prod and with `wrangler pages dev`

I have an Astro app with a page that gets a list of pets from the Petfinder API and displays them to the user. In order to auth with the API, I must first request a token from: https://api.petfinder.com/v2/oauth2/token. Ok, thats fine...it works locally, I get the oauth token and then correctly get the response from https://api.petfinder.com/v2/animals. When I push to my Workers & Pages cloudflare prod env, it fails and when testing with wrangler pages dev ./dist it fails running with wrangler pages: ``` petfinder.astro.mjs:95 Petfinder API error: Error: Failed to get token: 403 Forbidden - <html><head><title>Access Denied</title></head><body><h1>Access Denied</h1>You don't have permission to access "/v2/oauth2/token" on this server.<br/>0.a1c0ce17.1731210162.14ca9d7c</body></html>...

Best way to serve static assets using hono?

I want to create an endpoint (for ex endpoint.com/script.js) that serves a script file. right now, im returning the contents of the file directly by ```...

Can not access env.GITHUB_TOKEN in event handler

For some reason i can get my git hub token inside of the function i have done other debugging and it does work outside of the function. Normally i ask AI and it is pretty good at fixing my problems, Ive searched on here and online and i see where people have has problems similar but i can not get it fixed. here a paste bin of the cloud flare worker. if I hardcode the api key for testing it works just fine. https://pastebin.com/hUDWfrUH

Worker (client -> worker -> aws) price plan

hi guys. I listen to websocket connections in a simple worker and transfer it to the aws server. There is no use of a durable object. How will the pricing be ?...

Latency when proxing api calls from my cf worker -> my vps

Hi I have an API hosted on a VPS (typesense search) and when I hit it directly I get response times of 20-45ms when I make the exact same request but put my cloudflare worker infront of it (so request to worker -> vps -> to client). I get response times of over 300ms. Both the VPS and me are situated in London. ...

Long running ingest

I have an AWS ECS instance that all it does is run as me ingest data. Can I do the same with a worker. It doesn’t need to scale or receive http requests. It just ingests external data and stores it. Thanks!

Accessing a Worker from Indonesia served by LAX instead of the usual SIN edge location

Hi there -- I have a website (seniman.dev) that I deploy on Workers. The website would usually be served by the SIN edge location when accessing it from Indonesia at about 20ms latency, but as of yesterday the main website (and all the other Worker-deployed websites under the domain) would instead be served by the LAX edge location -- giving us 200ms latency. Anything I can do from my side? The workload is very much latency-sensitive so accurate edge location routing is important. Screenshot showing the edge location response headers is attached....
No description

Alternative to Workers that allows use of XMLHttpRequest

So I just needed to create an endpoint for this project I'm building, and in the endpoint I make a call that happens to make a XLMHttpRequest, does cloudflare offer an alternative resource that would let me make the call? Or do I need to create a serverless function with vercel and call that endpoint it wouldn't be ideal, but seems the only way to solve my problem currently, unless there are different serverless functions within Cloudflare that can handle XMLHttpRequests.

Webhooks, Websocket, SMTP and Drums, Push API with Workers

Well, I'm quite new to workers in general. I've managed to do what I originally planned so this is just me wanting to learn/try new stuff. Ok #1 is: I'm using Contentful which allows me to add Webhooks so I did. It makes a POST request to an specified URL, the worker gets the post request, formats the data and for now, just puts it in console.log. So in short, I make an entry in Contentful, Webhook, Workers gets it Here's the question, how can I make the backend interact with the frontend when a new request has been received? So when a new entry is made, the end result is, just for now, a console.log on the actual frontend (I can handle the rest, it's just the connection between both)...