I wrote previously about a hack to use SockJS with Stomp over WebSockets:
Stomp.WebSocketClass = SockJS; // same as usual var client = Stomp.client(url); [...]
However, this was ugly and of limited use: the instantiation of the Web Socket was still done inside
I have updated the library to use STOMP over any kind of WebSocket objects:
var ws = new SockJS(url); var client = Stomp.over(ws); // the rest of the code is the same [...]
As written in the documentation, you can use
Stomp.client(url) to let the library create regular WebSockets or use
Stomp.over(ws) if you required another type of WebSocket.
Web Sockets for everyone!