https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • k

    kian

    05/09/2023, 2:17 PM

    https://cdn.discordapp.com/attachments/779390076219686943/1105498845934264425/image.png▾

  • k

    kian

    05/09/2023, 2:17 PM
    This bit?
  • k

    kian

    05/09/2023, 2:17 PM
    Oh, I see what you mean
  • k

    kian

    05/09/2023, 2:18 PM
    I can't try anything since I don't have the add-ons
  • k

    kian

    05/09/2023, 2:18 PM

    https://cdn.discordapp.com/attachments/779390076219686943/1105499009528905779/image.png▾

  • u

    Unsmart | Tech debt

    05/09/2023, 2:18 PM
    Increment counter when is after the response comes in do you want to reduce the counter (for example failed reqs)
  • k

    kian

    05/09/2023, 2:18 PM
    I guess none of these will really work for it
  • d

    dave

    05/09/2023, 2:19 PM
    hmm is there a way I can detect if it's CF doing the rate limiting, or their backend?
  • k

    kian

    05/09/2023, 2:19 PM
    I kinda just relied on Cloudflare being able to ratelimit their own product haha
  • k

    kian

    05/09/2023, 2:19 PM
    Not sure why the Worker isn't an option but from the docs, it can't
  • k

    kian

    05/09/2023, 2:20 PM
    Probably response headers, if they have any that their origin adds that no-longer appear when you get 429'd - but you could also be ratelimited at another layer between them that also doesn't add them.
  • u

    Unsmart | Tech debt

    05/09/2023, 2:20 PM
    We blame discord for not applying different rate limits by cf-worker but not even cloudflare does it
  • s

    sathoro

    05/09/2023, 2:22 PM
    btw for what it is worth we call
    supabase.auth.getUser(jwt)
    from a Worker and have never once been rate limited or gotten any error response
  • d

    dave

    05/09/2023, 2:22 PM
    yep if we make our own tokens we don't get rate limiting as much
  • s

    sathoro

    05/09/2023, 2:22 PM
    ah it is for creating? that makes more sense
  • d

    dave

    05/09/2023, 2:27 PM
    yes. I figured out a cool trick where I use the user's password as a API key, which works perfectly with our billing model (since our pricing will be per "seat"/user/bot if you have a team with >1 members). We set the password to a JWT that's signed with a ECDSA (ES256) key, so we can validate it quickly before wasting time forwarding it to Supabase. By using it as a password, we get built in "revocation" too.
  • u

    Unsmart | Tech debt

    05/09/2023, 2:27 PM
    I'd assume its either not rate limited or rate limited by project and not ip
  • s

    sathoro

    05/09/2023, 2:28 PM
    per seat pricing models tho
  • d

    dave

    05/09/2023, 2:29 PM
    we're aiming for $1/day while the "alternative" is >$10/day. 😛
  • d

    dave

    05/09/2023, 2:30 PM
    hmm the nodejs debugger for Workers can't show requests?
  • j

    jøe

    05/09/2023, 2:32 PM
    Is it possible to retain apps when running workers?
  • u

    Unsmart | Tech debt

    05/09/2023, 2:35 PM
    I doubt it, apps isnt really maintained anymore so it acts in weird ways
  • d

    dave

    05/09/2023, 2:41 PM
    Copy code
    Response status: 429
    Response headers: {
      "access-control-allow-origin": "*",
      "alt-svc": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400",
      "cf-cache-status": "DYNAMIC",
      "cf-ray": "7c4ab23d588ddb15-MIA",
      "connection": "keep-alive",
      "content-length": "40",
      "content-type": "application/json",
      "date": "Tue, 09 May 2023 14:40:12 GMT",
      "sb-gateway-version": "1",
      "server": "cloudflare",
      "strict-transport-security": "max-age=2592000; includeSubDomains",
      "vary": "Origin, Accept-Encoding",
      "via": "kong/2.8.1",
      "x-kong-proxy-latency": "0",
      "x-kong-upstream-latency": "0"
    }
    Does this mean the rate limiting is applied outside of Cloudflare?
  • s

    Skye

    05/09/2023, 2:42 PM
    it's returning headers from something behind CF, so yeah
  • k

    kian

    05/09/2023, 2:42 PM
    Id say so yeah
  • s

    sathoro

    05/09/2023, 2:45 PM
    Supabase uses Kong for their API gateway
  • d

    dave

    05/09/2023, 2:46 PM
    Will
    CF-Connecting-IP
    be set to
    2a06:98c0:3600::103
    if the subrequest target domain is on CF, but the subdomain is not proxied by CF? https://developers.cloudflare.com/fundamentals/get-started/reference/http-request-headers/#cf-connecting-ip-in-worker-subrequests
  • k

    kian

    05/09/2023, 2:47 PM
    It's just if it's cross-zone or not
  • s

    silentdevnull

    05/09/2023, 2:47 PM
    If I create a worker that connects go a web socket (wss) to lesson / watch for updates. Will it get shutdown or does it stay running as long as there a connection to the wss?
  • s

    sathoro

    05/09/2023, 2:48 PM
    It depends on if there is a connection to the worker or not
1...244924502451...2509Latest