Is there a safe/supported way to access the underlying sockjs connection?

I believe sockjs errors are triggering infinite reload loop in my application.

I’d like to try to access the underlying connection to try and capture/trace the errors and if possible handle them before it spirals into an infinite reload loop.

Does anyone do anything like this currently?

Also, I don’t have any experience with SockJS, so I’d appreciate any suggestions.

1 Like

Here’s some logs to illustrate my point. Below you can see the refresh happening (unload() handler and route log), each time generating a new sockjs connection id (example: cb=loh0xfiabf).

sockjs-0.3.4.js:854 XHR finished loading: GET “http://localhost:3000/sockjs/info?cb=loh0xfiabf”.AbstractXHRObject._start @ sockjs-0.3.4.js:854(anonymous function) @ sockjs-0.3.4.js:888
00_client_utility.js?ea7d032b5da5591988ae7655d74b845afff848d1:7 Handler for .unload() called.
Navigated to http://localhost:3000/
sockjs-0.3.4.js:854 XHR finished loading: GET “http://localhost:3000/sockjs/info?cb=ofoqrou482”.AbstractXHRObject._start @ sockjs-0.3.4.js:854(anonymous function) @ sockjs-0.3.4.js:888
00_client_utility.js?ea7d032b5da5591988ae7655d74b845afff848d1:7 Handler for .unload() called.
Navigated to http://localhost:3000/
sockjs-0.3.4.js:854 XHR finished loading: GET “http://localhost:3000/sockjs/info?cb=eczxkln35e”.AbstractXHRObject._start @ sockjs-0.3.4.js:854(anonymous function) @ sockjs-0.3.4.js:888
00_client_utility.js?ea7d032b5da5591988ae7655d74b845afff848d1:7 Handler for .unload() called.