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

    kian

    03/22/2023, 11:02 AM
    use
    tee()
    on the
    body
    object and that'll give you two streams
  • k

    kian

    03/22/2023, 11:03 AM
    https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee
  • k

    kian

    03/22/2023, 11:04 AM
    you'd probably want to do the cache put in a waituntil
  • k

    kian

    03/22/2023, 11:04 AM
    otherwise you're only reading one stream at a time & causing buffering
  • c

    Crazy Rabbit

    03/22/2023, 11:09 AM
    with tee() it seems to be working now, thanks
  • s

    sathoro

    03/22/2023, 11:32 AM
    suddenly been getting a lot of these errors reported in Sentry
    Network connection lost.
    for our worker, even on routes where we just connect to Durable Objects and not anything like a third-party API (although I realize DO is essentially a third party API). unfortunately there is no stack trace or context on the error. any ideas?
  • c

    Crazy Rabbit

    03/22/2023, 12:07 PM
    Actually worker serving images from R2 is like 2x faster than using public CDN.
  • g

    gunnars04

    03/22/2023, 12:46 PM
    Hi, are you guys using CF Workers as a reverse proxy, or as your only backend? πŸ™‚
  • c

    Crazy Rabbit

    03/22/2023, 12:47 PM
    sathoro or me?
  • g

    gunnars04

    03/22/2023, 1:18 PM
    Just anybody, I'm curious πŸ™‚
  • k

    kian

    03/22/2023, 1:25 PM
    both
  • k

    kian

    03/22/2023, 1:25 PM
    some just transform a response on top of an existing origin
  • k

    kian

    03/22/2023, 1:25 PM
    some are the origin
  • g

    gunnars04

    03/22/2023, 1:34 PM
    @kian What's the criteria when you use which? πŸ™‚
  • k

    kian

    03/22/2023, 1:35 PM
    just depends if a Worker is fit for the origin - our main apps are Laravel monoliths so Workers could only ever serve as an on-top layer
  • k

    kian

    03/22/2023, 1:36 PM
    whereas for a Discord bot that uses application commands, you can run it entirely on Workers
  • g

    gunnars04

    03/22/2023, 1:40 PM
    @kian So new system that CF Worker can solve = CF Worker (as your only backend) If not (f.ex. legacy system), then CF Worker as reverse proxy?
  • s

    Silent

    03/22/2023, 1:45 PM
    hosting a discord bot on workers seems to be possible, what would the limitations of free accounts be to the bot?
  • k

    kian

    03/22/2023, 1:45 PM
    It can only do application commands (which are webhooks sent to your Worker via Discord) rather than gateway (which is when your bot subscribes to a WebSocket)
  • k

    kian

    03/22/2023, 1:45 PM
    That's not unique to the free plan though
  • r

    renzor

    03/22/2023, 4:41 PM
    has anyone ran into this error when fetching a site enforcing TLS 1.3 from a worker?
    Copy code
    fetch('https://mysite.com')
    Copy code
    OpenSSL error; message = error:1000042e:SSL 
    routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION
  • r

    renzor

    03/22/2023, 4:42 PM
    do i have to lower my TLS version to use workers?
  • c

    computeronix

    03/22/2023, 7:55 PM
    not sure if anyone got sha3 working in workers (without using wrangler) i tried used crypto.subtle.digest('SHA-3-256', messageBytes); but it appears this is not implemented yet and it lets me save the code (which is odd usually if this wasnt implemented it wouldn't let me save the code, it crashes the dom lol πŸ˜„ anyone have thoughts on getting sha3 - 256 working in workers (without using wranglar πŸ˜„ )
  • k

    kian

    03/22/2023, 8:05 PM
    Is that a WebCrypto algorithm?
  • k

    kian

    03/22/2023, 8:06 PM
    It's not on
  • k

    kian

    03/22/2023, 8:06 PM
    SHA-256 and SHA-384 are, but I have no idea what SHA-3-256 is
  • k

    kian

    03/22/2023, 8:06 PM
    Ah, yeah - https://github.com/w3c/webcrypto/issues/319
  • c

    computeronix

    03/22/2023, 8:09 PM
    thats the one :D. trying to do a merkle tree in cloudflare worker (without a wrangler) and its driving me crazy πŸ˜„
  • c

    computeronix

    03/22/2023, 8:09 PM
    literally one command away and i might have to break out wrangler πŸ˜„
  • s

    Spoleto

    03/22/2023, 8:36 PM
    Any way to detect if google bot (or other crawler) inside worker?
1...235323542355...2509Latest