0

I have a question - I have java spring web application with websocket,sockjs implementation following this tutorial https://spring.io/guides/gs/messaging-stomp-websocket/ and I need to connect with NodeJS to this server application. Server app is OK because I managed to connect via web app and it is working but the problem comes when I try to implement it to nodejs. so to make this clear - SERVER is Java Spring MVC + websocket + sockJS - CLIENT is NodeJS + missing libs (STOMP, SockJS)

I tried maybe 10 different approaches but with no luck, websocket seems to be connected but I have problem to attach stomp to sockjs.

Brian Clozel
  • 56,583
  • 15
  • 167
  • 176
ememem
  • 316
  • 1
  • 3
  • 15

1 Answers1

0

Now sure what other 10 different approaches you tried, have you tried to use an official JS Client library for SockJS and then add Stomp to it like this (take from the official Stomp page):

var Stomp = require('stompjs');
var ws = new SockJS(url);
var client = Stomp.over(ws);
Maksim
  • 16,635
  • 27
  • 94
  • 135