Replies: 6 comments 1 reply
-
Hello @ben-xD , I'm not sure I understand what "WebSocket endpoints" are. From your code samples, if I understand correctly, you meant that there are similarities between Request My experience with Websockets is limited to this library: And as you may see from the example there, it has a slightly separated workflow (dedicated event-based server). So... I'm not sure that the existing entities (like EndpointsFactory) could be reused in any suitable way for integrating websockets. However, since On the other side, making websockets entry easier seems interesting. Please let me know if you have any recommendations or visions on how this idea could be implemented. |
Beta Was this translation helpful? Give feedback.
-
Dear @ben-xD , would you be interested in testing this feature: Could it help you to achieve the desired functionality? Your feedback is appreciated — please let me know. |
Beta Was this translation helpful? Give feedback.
-
Hello @ben-xD , I actually decided to move that feature to a separate project, which is basically attachable to any HTTP server, including the one returned by Check this out: https://www.npmjs.com/package/zod-sockets Would you try to install version 0.2.0 or higher for your sample project and let me know if it's usable, understandable, make sense, etc. So far, this thing is capable to listen for incoming events, acknowledge them, emit and broadcast events and handle their acknowledgements. All that is validated and you can connect the logger from Rooms and namespaces are not yet supported. |
Beta Was this translation helpful? Give feedback.
-
Latest news on that matter for those who interested, CC @ben-xD : https://github.com/RobinTail/zod-sockets
Check it out. |
Beta Was this translation helpful? Give feedback.
-
Dear @ben-xD , did you have a chance to look at or try zod-sockets ? |
Beta Was this translation helpful? Give feedback.
-
I made a lightweight alternative using Server-sent Events. |
Beta Was this translation helpful? Give feedback.
-
It would be nice if we could define WebSocket endpoints that clients can call, which establishes a connection. The handler would give developers a
subscription
, which they can store to send messages to the client later, or close the websocket.Example
subscribeEndpoint
, which sets up a websocket between them and the server.sendMessageEndpoint
, messages are broadcast to all subscribers.Beta Was this translation helpful? Give feedback.
All reactions