WebSocket support
See original GitHub issueHave you ever thought about adding WebSocket support?
I am looking for a way to push XML messages to clients to enable multi-client xml-applications and WebSockets would be an ideal fit.
I added a %rest:WEBSOCKET
annotation to test the concept and got it to work, so I was wondering if something like this was ever on the roadmap for BaseX/RESTXQ?
Thanks! Mike
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:33 (28 by maintainers)
Top Results From Across the Web
The WebSocket API (WebSockets) - Web APIs - MDN Web Docs
desktop desktop
Chrome Edge
WebSocket Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
WebSocket() constructor Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
Read more >Web Sockets | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >WebSocket - Wikipedia
WebSocket is a computer communications protocol, providing full-duplex communication ... Most browsers support the protocol, including Google Chrome, Firefox, ...
Read more >25. WebSocket Support - Spring
WebSocket Support. This part of the reference documentation covers Spring Framework's support for WebSocket-style messaging in web applications including use of ...
Read more >What is WebSocket and How It Works? ⚙️ - Wallarm
WebSocket enables two-way interactive communication sessions between client and server without having to poll the server for a reply, providing both speed ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The first implementation of websockets can be found in the masterbranch now.
Import in XQuery:
import module namespace ws = "http://basex.org/modules/Websocket";
Overview of the new Annotations:
Possible ws:param’s:
%ws:param("Http-Version", "{$version}")
Overview of new Functions
The Path is always the Path the Client connects to.
A quick-and-dirty-example for the most of the new Annotations/Functions can be found here: https://github.com/jfinckh/chat/tree/master
We would be pleased about feedback and further extensions.
Hi, sorry for the late reply, I was swamped with work the last days.
Thanks for the mailing list link!
I just added https://github.com/TooTallNate/Java-WebSocket, added the
%rest:WEBSOCKET
annotation and send the serialized XML via the WebSocket to all connected clients when creating theRestXqResponse
. But this was just for a prototype and is far from production code!The websocket support is actually part of my master thesis on multi-client XML applications. I need to notify a group of connected clients about changes to the database (e.g. for an XML chat application, or multi-client word processing like Google Docs)
At the moment, I’m trying to figure out an API/annotation-parameter to specify that WebSocket messages should only be sent to either all clients, a subgroup or just one. An example would be a chat server, which allows users to join specific chat rooms. As soon as a message is posted and stored in the database, only the clients inside the room should receive a WebSocket message containing the new database state.
As soon as I got that, I’ll post a clean/non-hacky pull request (adding the WebSocket like mentioned on the mailing list).