marcoeg
WWasp-lang
•Created by dbalbo on 9/13/2024 in #đŸ™‹questions
websockets - emit event from server
after setting REACT_APP_API_URL in .env.client it is now attempting to open the WebSocket from the right server. Failing for CORS issues now but should be solved with proper middleware setup.
16 replies
WWasp-lang
•Created by dbalbo on 9/13/2024 in #đŸ™‹questions
websockets - emit event from server
even with WASP_SERVER_URL set in .env.server Wasp is attempting to establish a WebSocket connection to localhost.
16 replies
WWasp-lang
•Created by dbalbo on 9/13/2024 in #đŸ™‹questions
websockets - emit event from server
trying with setting up WASP_SERVER_URL
16 replies
WWasp-lang
•Created by dbalbo on 9/13/2024 in #đŸ™‹questions
websockets - emit event from server
16 replies
WWasp-lang
•Created by dbalbo on 9/13/2024 in #đŸ™‹questions
websockets - emit event from server
Yes, that is the correct way to do it. Assigning
socket
works. Thank you!16 replies
WWasp-lang
•Created by dbalbo on 9/13/2024 in #đŸ™‹questions
websockets - emit event from server
This is very helpful but I still cannot figure out how to send an event to a specific listener. The pattern I would like to implement is very similar, but I would like a client to be able to subscribe to events for the users that is logged in in that client.
socket.js:
API code:
All connected clients receive the event.16 replies