436 reads
4 comments
Great article, thank you. But how is it possible to define backend url for WebSocket object? You hardcode it here, but not clear, how to define it on frontend dynamically.
For my experiment I didn't bother figuring that out. But when I deployed my example app I did change it to wss://app-url.com/.redwood/functions/ws
to get around CORS limitations (where .redwood/functions/
is proxied to my api side by my hosting setup, just like all graphql requests are proxied)
Thanks for the answer. Another question, do you know why wss doesn't pass authentification token into backend handler, so we can't authentificate the request?
I don't think WebSockets does that. Have a look at this StackOverflow question and read the answer and the comments on the first question stackoverflow.com/questions/4361173/http-h…