https://discord.cloudflare.com logo
Join Discord
Powered by
# functions
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:19 PM
    But the actual Node.JS packages aren't supported (like
    fs
    and
    http
    ) and I don't know if they ever will be.
  • t

    the-philociraptor

    03/17/2022, 12:20 PM
    One of the things I truly โ€œneedโ€ is the dynamodb package and I think I saw a workers example using it
  • t

    the-philociraptor

    03/17/2022, 12:21 PM
    https://github.com/cloudflare/workers-aws-template
  • t

    the-philociraptor

    03/17/2022, 12:21 PM
    So is that not possible with functions today?
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:23 PM
    Oh, AWS' SDK works fine in Workers (and I'm pretty sure in Pages too I think). You just need to make sure to use v3, that's all.
  • t

    the-philociraptor

    03/17/2022, 12:26 PM
    Okay, that's one of my core dependencies. the others I think I can work around... but not ideal. That at least puts it back on the table as an option I guess, but still a lot of work to "convert". ๐Ÿ˜„
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:26 PM
    ๐Ÿ˜„
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:27 PM
    You could always try DynamoDB's HTTP API... There's this for authenticating without sorting out all of the confusing auth details. It's what I do. https://github.com/mhart/aws4fetch
  • t

    the-philociraptor

    03/17/2022, 12:45 PM
    Crap, I just remembered I also have a dependency on ZMQ which looks like it'd probably not be great to re-write nor would it work as written. -_-
  • t

    the-philociraptor

    03/17/2022, 12:46 PM
    To be clear, I don't need the daemon side. I know that workers don't work like that. I need to be able to connect to a socket on the other side and use ZMQs framework to communicate out.
  • t

    the-philociraptor

    03/17/2022, 12:46 PM
    So I guess it's off the table again. ๐Ÿ˜„
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:47 PM
    Yeah, I don't know if you'll even be able to rewrite that. Worker's don't allow sockets right now, although there was a blog post late last year so it might be planned.
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:47 PM
    HTTP only for now, even outgoing.
  • t

    the-philociraptor

    03/17/2022, 12:48 PM
    I guess I could queue up messages in SQS and have a lambda with proper node support handle them. But then it's like... at what point does this start not making sense to do.
  • t

    the-philociraptor

    03/17/2022, 12:55 PM
    Is there a list of these known "caveats" with functions and/or workers? I've been reading the cloudflare docs since we've been talking and it's... lackluster at best. For example, there is a page here that talks about using sockets? https://developers.cloudflare.com/workers/learning/using-websockets/ I think it's correct to say that functions don't have feature parity with workers either?
  • t

    the-philociraptor

    03/17/2022, 12:55 PM
    Do you just have to try it and find out it doesn't work? ๐Ÿ˜„
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:55 PM
    No, that's for Websockets. Websockets work fine, it's TCP sockets that don't. Sorry ๐Ÿ˜„
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:56 PM
    And yeah, WebSockets should work fine in Functions I think? Functions is currently running a really old runtime since it's in Beta so not entirely sure.
  • t

    the-philociraptor

    03/17/2022, 12:56 PM
    Ahhh, case of me being dumb
  • t

    the-philociraptor

    03/17/2022, 12:57 PM
    Trying to wrap my head around all of the roadblocks I will hit now and might hit in the future.
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:57 PM
    Yeah, no worries. ๐Ÿ™‚
  • t

    the-philociraptor

    03/17/2022, 12:57 PM
    I realllllly like the idea of workers. I really wanna make it work.
  • t

    the-philociraptor

    03/17/2022, 12:58 PM
    Right now I'm using ECS to host the API in a container
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 12:58 PM
    Cool, bet that gets expensive though ๐Ÿ˜ฆ
  • t

    the-philociraptor

    03/17/2022, 12:58 PM
    Yeah, no doubt. Especially with AWS' bandwidth costs.
  • t

    the-philociraptor

    03/17/2022, 12:59 PM
    Part of why "your code runs in 200+ DCs" sounds lucrative. Low latency. Impossible to "take down"
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 1:00 PM
    Yeah, Workers are amazing. ๐Ÿ˜„
  • t

    the-philociraptor

    03/17/2022, 1:01 PM
    Thanks for your time and help by the way; really appreciate it. I'm still fumbling around on if I have the time and willpower to switch. I'll probably be back. ๐Ÿ˜„
  • i

    Isaac McFadyen | YYZ01

    03/17/2022, 1:05 PM
    No worries, let me know if you have any more questions ๐Ÿ‘
  • t

    the-philociraptor

    03/17/2022, 2:09 PM
    I did come up with another theory you might be able to shoot down ๐Ÿ˜‚. So Iโ€™d like to at least use pages for the time being. My api is at
    /api
    and short of paying for the enterprise plan; there is no โ€œpre-builtโ€ solution for path based routing. Workers however does have the same feature it seems as the resolveoverride in the enterprise page rules: https://developers.cloudflare.com/workers/runtime-apis/request/#requestinitcfproperties It seems like I can just create a page function to effectively do the same thing. Does this sound like a viable way to do โ€œredirectโ€ said traffic? Or is there a better way to route the traffic for
    /api
    to a completely different host?
1...99100101...392Latest