Questions tagged [sockjs]

SockJS is a browser JavaScript library that provides a WebSocket-like object that gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.

SockJS is a browser JavaScript library that provides a WebSocket-like object. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.

Under the hood SockJS tries to use native WebSockets first. If that fails it can use a variety of browser-specific transport protocols and presents them through WebSocket-like abstractions.

SockJS-client is intended to work for all modern browsers and in environments which don't support WebSocket protocol, for example behind restrictive corporate proxies. [ https://github.com/sockjs/sockjs-client ]

SockJS-node is a Node.js server side counterpart of SockJS-client browser library written in CoffeeScript. [ https://github.com/sockjs/sockjs-node ]

617 questions
15
votes
3 answers

Difference between /topic, /queue for SimpleMessageBroker in Spring Websocket + SockJS

Is there a clarification, what is the differences between /topic, /queue etc. for Spring Websocket + SockJS in case I am using "simple broker" ? E.g. here Sending message to specific user on Spring Websocket it is said: when your client subscribe…
Askar Ibragimov
  • 6,494
  • 15
  • 65
  • 132
14
votes
2 answers

Providing auth header with SockJS

I have a Spring MVC server that provides a bunch of REST endpoints as well as a websocket endpoint. Everything except the login endpoint requires authentication. I'm using JWT to authenticate requests coming from the client. When the user logs in…
L Morris
  • 201
  • 1
  • 2
  • 5
13
votes
3 answers

How to send custom message to custom user with spring websocket?

I'm new to spring websocket. I want to send product changes to clients. For this, I want to do it as follows: Client creates a socket connection and subscribes destination: var socket = new SockJS('/websocket'); var stompClient =…
Morteza Malvandi
  • 1,144
  • 2
  • 22
  • 59
13
votes
1 answer

What are issues with using WebSockets with proxies and load balancers?

I'm reading up on SockJS node server. Documentation says: Often WebSockets don't play nicely with proxies and load balancers. Deploying a SockJS server behind Nginx or Apache could be painful. Fortunately recent versions of an excellent load…
dev.e.loper
  • 34,180
  • 71
  • 151
  • 237
12
votes
0 answers

Spring websocket (WSS) with angular sockjs (HTTPS) over secure web socket server (tomcat)

I'm working on sending messages from the server side to angular client application using Spring web socket + stomp + SockJsClient at server side and SockJS at the angular side. My Socket server is a spring boot application and running on 8080…
John Martin
  • 123
  • 1
  • 5
12
votes
2 answers

How to tell when a Stomp server disconnected from the Stomp.JS client

I am sending a stomp message over a Sock.JS client. When I disconnect the server I would like a warning message to show up on the client. To do this I have implemented a server side heartbeat stompClient =…
Jackie
  • 17,579
  • 26
  • 116
  • 227
11
votes
2 answers

Spring websockets Broken pipe & client not receiving messages

I have a few problems with using websockets: java.io.IOException: Broken Pipe Client doesn't receive messages TL;DR Main things I want to know: Please list all possible scenarios why the client side closes the connection (apart from refreshing…
J. Kamans
  • 545
  • 5
  • 16
11
votes
3 answers

How to increase output buffer for spring sockjs websocket server implementation

I have used spring implementation of sockjs websocket server and unable to transmit message over 8KB, following is the error 2014-02-12 19:36:29,990 - org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession - DEBUG -…
cpandey05
  • 1,111
  • 2
  • 15
  • 30
10
votes
1 answer

Spring boot Websocket with stomp js: I keep getting Whoops! Lost connection to http://localhost:8080/ws

I want to integrate chatting into an application I made, and after following some tutorials and running the application I keep getting "Whoops! Lost connection to http://localhost:8080/ws" on my console I tried using sockjs path as"/ws" but still…
appzone_oto
  • 197
  • 1
  • 15
10
votes
3 answers

how to await subscriptions established?

I have the following js code: stompClient.subscribe('/topic/clients', function (calResult) { updateClientsTable(JSON.parse(calResult.body)); }); $.get("/clients", null); and following server code(last line invokes it): @GetMapping(value =…
gstackoverflow
  • 31,683
  • 83
  • 267
  • 574
10
votes
2 answers

Prevent React Router from routing a server API path

On the server an API only path has been set under /api. When calling this path on the client-side, react-router takes over and responds with: browser.js:49 Warning: [react-router] Location "/api/my_request" did not match any routes How can we…
BAR
  • 12,752
  • 18
  • 79
  • 153
10
votes
1 answer

Why does sockJS add a '/info' to a given websocket url path

I want to open a websocket port with a "webapp/socket.do" path. When I use SockJS and try to initiate the call by code var socket = new SockJS('/webapp/socket.do'); stompClient = Stomp.over(socket); stompClient.connect({}, ... SockJS…
Lihkinisak
  • 659
  • 1
  • 7
  • 12
10
votes
3 answers

Stomp over websocket using Spring and sockJS message lost

On the client side javascript I have stomp.subscribe("/topic/path", function (message) { console.info("message received"); }); And on the server side public class Controller { private final MessageSendingOperations
user2001850
  • 449
  • 3
  • 13
10
votes
2 answers

SockJS Client auto reconnect?

I'm trying to figure out a way for my SockJS clients to reconnect to the server if it should go down. I currently have this: new_conn = function() { socket = new SockJS(protocol + serverDomain + '/echo', null, { …
Alosyius
  • 7,553
  • 26
  • 69
  • 113
9
votes
0 answers

warning sockjs.js:2998 WebSocket connection to failed: WebSocket is closed before the connection is established

I am having a Angular 8 front end code. When built it shows following error in browser console. Getting warning sockjs.js:2998 WebSocket connection to 'ws://localhost:4200/sockjs-node/173/ypgvodsj/websocket' failed: WebSocket is closed before the…
1
2
3
41 42