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

    Skye

    05/03/2023, 4:20 PM
    You can fill out the increase request form @ to try and request increases
  • s

    Skye

    05/03/2023, 4:20 PM
    But a plan based one is probably ent only
  • s

    sathoro

    05/03/2023, 4:21 PM
    Yeahhh probably
  • s

    sathoro

    05/03/2023, 4:21 PM
    Also, does Date.now() update after doing a network request? I thought I saw that somewhere
  • s

    Skye

    05/03/2023, 4:21 PM
    It does after any I/O
  • u

    柴柴

    05/03/2023, 4:22 PM
    Will the following appear when using this quick edit
  • s

    Skye

    05/03/2023, 4:23 PM
    I don't know what that says, sorry
  • u

    柴柴

    05/03/2023, 4:23 PM
    sorry
  • u

    柴柴

    05/03/2023, 4:24 PM
  • s

    Skye

    05/03/2023, 4:24 PM
    I believe it works fine on the new one, yep
  • u

    柴柴

    05/03/2023, 4:24 PM
    okay, thank you
  • s

    silentdevnull

    05/03/2023, 4:50 PM
    I'm following the documentation on the workers site for getting headers.
    Copy code
    const headers = new Headers();
        console.log(headers.get('name'))
    It keeps coming back null. I'm sending a custom here with the request from postman
  • s

    Skye

    05/03/2023, 4:52 PM
    Not sure what you're expecting that code snippet to do - you make an empty headers object, then check if it has something in it 😅
  • s

    Skye

    05/03/2023, 4:52 PM
    Did you mean
    request.headers.get('name')
    ?
  • j

    James

    05/03/2023, 4:52 PM
    You probably want
    req.headers.get('name')
    ? You're creating an empty
    Headers
    object there and then reading from it... yeah what Skye said
  • s

    silentdevnull

    05/03/2023, 5:00 PM
    Would I add the request part in the
    Copy code
    addEventListener('fetch', (e) => {
        e.respondWith(router.handle(e.request))
    });
    or the
    Copy code
    router.get("/", () => {
        return new Response("Hello World")
    });
  • j

    James

    05/03/2023, 5:03 PM
    It looks like you're passing the
    request
    to your router, so you'd need to modify your router handler function like this:
    Copy code
    js
    router.get("/", (request) => {
        const name = request.headers.get('name'); // here
        return new Response("Hello World")
    });
  • j

    James

    05/03/2023, 5:03 PM
    Note the
    request
    argument in the handler there primarily
  • k

    Kilna

    05/03/2023, 5:12 PM
    Is a good pricing estimator anywhere for websocket workers + durable objects?
  • d

    Dani Foldi

    05/03/2023, 5:24 PM
    You can sort of use https://pricing.ceru.dev - every incoming connection and incoming websocket message counts as a request, and any time a DO instance has a ws connected to it, counts as runtime
  • k

    Kilna

    05/03/2023, 6:00 PM
    Thanks! Man, as a guess it looks like long-running high-interactivity tabletop games might be too expensive to be feasible in Workers 😦 I have a card game where you drop cards in a turnless fashion so clients needs to be in a connected state to get updates in a resonable time. A tabletop runs continuously, we'd need at least one running 24/7, and an ideal state would be running hundreds or thousands of tables at the same time. A single $20 VM instance could probably handle hundreds as a guess, but it sounds like it'd be orders of magnitude more pricey with workers.
  • k

    Kilna

    05/03/2023, 6:03 PM
    Which sucks 'cause Workers does seem like the right solution for every other problem I'm trying to solve other than cost.
  • d

    Dani Foldi

    05/03/2023, 6:07 PM
    % agree, there is something in the works that means inactive DOs won't get charged
    k
    • 2
    • 2
  • s

    silentdevnull

    05/03/2023, 6:25 PM
    Thank you that worked
  • w

    Wichard

    05/03/2023, 10:32 PM
    How are IPs assigned to workers? For example if worker A makes an HTTP request to an external server, and worker B makes an HTTP request to the same server, will the server view them as having the same IP, different ones, or are these rotated somehow?
  • w

    Walshy | Pages

    05/03/2023, 10:35 PM
    In that example they'll be Cloudflare egress IPs (https://www.cloudflare.com/ips/)
  • w

    Walshy | Pages

    05/03/2023, 10:35 PM
    if you were to fetch another Cloudflare zone, it'd be a static IP identifying Workers
  • w

    Wichard

    05/03/2023, 10:37 PM
    In my case they are in the same zone. So each worker will get assigned a different egress IP?
  • k

    kian

    05/03/2023, 10:44 PM
    It’s not related to the Worker
  • k

    kian

    05/03/2023, 10:44 PM
    It’s the same as if you just had the website proxied
1...243424352436...2509Latest