Replies: 3 comments 3 replies
|
For anyone else really struggling with this, if you're using the cloudflare_durable nitro preset, here's the best "hack" I've been able to find, using as Then you can: But.... YUCK, this pollutes with global state vs "serverless", and much complex too. It would be much better to have easy access the event passed in to crossws in the first place, but it doesn't expose it, only on peer._internal. |
0 replies
|
Have you tried to access bindings from |
1 reply
|
Would really love a solution for this issue, going down the same road |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Because cloudflare does not set process.env (ugh, I wish they did, but that's another story), to access any bindings, secrets etc you need access to the cloudflare env, passed with every request.
This is well documented for regular HTTP requests: https://nitro.build/deploy/providers/cloudflare#direct-access-to-cloudflare-bindings
It would be great to document the right way to access the cloudflare env, like bindings, from a websocket handler.
All reactions