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

    Vadim

    02/26/2023, 7:53 AM
    Thanks I checked the docs and it says:
    30s of CPU time per request, including websocket messages
    how should I keep the DO's ws connection to the remote server open? Do I alarm it to reset the 30s CPU time or is there a better way?
  • h

    HardAtWork

    02/26/2023, 7:54 AM
    If you receive a WebSocket message before the 30 second CPU limit, the timer will reset
  • h

    HardAtWork

    02/26/2023, 7:55 AM
    But yeah, if that isn’t enough, an Alarm should work
  • v

    Vadim

    02/26/2023, 7:56 AM
    Ah so if my worker receives data from the remote server at 1s intervals it basically runs forever? Except for the redeployment and new workerd releases?
  • h

    HardAtWork

    02/26/2023, 8:01 AM
    Yes
  • v

    Vadim

    02/26/2023, 8:01 AM
    👍 thank you very much
  • d

    DanTheGoodman

    02/26/2023, 2:42 PM
    Do workers automatically add a
    x-forwarded-for
    header when responding with a
    fetch()
    ? I am proxying a request with a worker and I never added it, but I see this is hitting the origin with a non-known cloudflare IP (according to IP ranges)
  • z

    zizi

    02/27/2023, 7:13 AM
    does sockets for worker will follow same direct sockets API proposal? https://github.com/WICG/direct-sockets/blob/main/docs/explainer.md
  • t

    Tom Sherman

    02/27/2023, 7:17 AM
    I was assuming no, assuming they'd go the Deno route and create their own API
  • t

    Tom Sherman

    02/27/2023, 7:19 AM
    But that was before I learned this proposal existed, so it's likely I'm wrong!
  • g

    GuillaumeLakano

    02/27/2023, 7:30 AM
    Hi! I would like to have a confirmation price about service bindings. If I call from a worker another worker via service binding, do this cost like 2 workers requests on the pricing ?
  • t

    Tom Sherman

    02/27/2023, 7:37 AM
    You never pay for a request to a worker, or any request from a worker (subrequests) for that matter. There are limits on subrequests, a worker calling another one via a service binding is one subrequest I believe https://developers.cloudflare.com/workers/platform/limits/#subrequests
  • z

    zegevlier

    02/27/2023, 8:42 AM
    This sample uses the latest version of the API implemented in workerd https://github.com/cloudflare/workerd/blob/main/samples/tcp/gopher.js
  • z

    zizi

    02/27/2023, 9:46 AM
    Thanks. seems this is deno way.
  • c

    CK

    02/27/2023, 2:52 PM
    Hey guys, I have really simple HTML/CSS/JS static website and I want to include form that will send emails to me. What is the simplest way to do that? I tried the normal way with PHP form but it does not work(returns 405)
  • c

    Crazy Rabbit

    02/27/2023, 5:28 PM
    Workers does not support PHP.
  • c

    Crazy Rabbit

    02/27/2023, 5:28 PM
    Where and how is your website currently hosted?
  • r

    ryeshrimp

    02/27/2023, 8:59 PM
    Has anyone ever had any issues with ethersjs and cloudflare workers in regards to this error? > Some functionality, such as asynchronous I/O, timeouts, and generating random values, can only be performed while handling a request.
  • h

    HardAtWork

    02/27/2023, 9:00 PM
    A lot of the crypto-specific libraries are written basically exclusively for node, and thus perform poorly(if at all) on Workers.
  • r

    ryeshrimp

    02/27/2023, 9:01 PM
    Makes sense. Is there any work arounds on the worker level or we kind of out of luck and forced to unwrap the functioanality
  • h

    HardAtWork

    02/27/2023, 9:02 PM
    Unless you can find a library tailor-made for non-Node platforms, it looks like you will just have to write it yourself.
  • r

    ryeshrimp

    02/27/2023, 9:02 PM
    I appreciate the response, thanks.
  • r

    ryeshrimp

    02/27/2023, 9:03 PM
    For what it's worth, this specific library is not node specific. It's a library that works on the frontend so it shouldn't really be having issues.
  • h

    HardAtWork

    02/27/2023, 9:04 PM
    Then it shouldn't be as difficult. You just have to crawl through the code and see if it is doing some kind of I/O in the global scope, and then move it back into the Request path.
  • w

    William Blankenship

    02/27/2023, 9:10 PM
    I'm working on a website that needs a "print pdf" button. The printed page looks great on modern desktop browsers like firefox - but is a disaster on some others. Seems like the Rendering API is exactly what I'm looking for. Do I need to do anything special on my account to get that setup? Is pricing announced for that yet?
  • d

    dave

    02/27/2023, 9:11 PM
    Does putting the same thing into the cache again cause the expiry date to be extended?
  • h

    HardAtWork

    02/27/2023, 9:11 PM
    I don't think it is even in an internal beta yet, so it might be a while before we get to know any of that.
  • h

    HardAtWork

    02/27/2023, 9:11 PM
    Yes
  • d

    dave

    02/27/2023, 9:11 PM
    nice, I'll do that.
  • h

    HardAtWork

    02/27/2023, 9:11 PM
    Or well, not really extended, more like overwritten
1...230523062307...2509Latest