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 ]

650 questions
8
votes
1 answer

Manually set transport type on a Spring + Sockjs application

I need to install an application on a non JEE7 compliant server. I am using Spring + Stomp + SocksJs for realtime notifications. My code looks like this: @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig extends…
pallendes
  • 95
  • 1
  • 1
  • 9
7
votes
2 answers

React Native STOMP over websocket

I'm trying to build a React Native messaging app throught websocket and STOMP protocol (For the server side I'm using Spring Boot) but I get a really weird behaviour. My code is the following: ... import SockJS from 'sockjs-client'; // Note this…
7
votes
1 answer

ReactJS could not proxy request from localhost:3000 to localhost:3003

I am writing a SPA using create-react-app and am using an expressjs server as my backend. For development I run my frontend test server on port 3000 and my backend expressjs test server on 3003. I make many API calls client side using Axios so for…
slugz
  • 137
  • 1
  • 12
7
votes
1 answer

Websocket vs SockJS object

I am wondering why you are able to initialize a normal javascript websocket with: var socket = new WebSocket('ws://example.com/myprefix') But with SockJS you need to call a normal http(s) url: var sock = new…
David542
  • 104,438
  • 178
  • 489
  • 842
7
votes
2 answers

How to secure websocket application [Spring boot + STOMP]

Good morning, I've created a simple Spring Boot WebSocket application. Right now I would like to set some security to it. I've trying some examples but I cannot get it worked. I'm getting error: web browser: >>>…
Andrew
  • 235
  • 2
  • 4
  • 15
7
votes
1 answer

Jersey hides Spring framework and SockJS

We're trying to expose sockjs endpoints with Spring Framework WebSocket support. This is the configuration on the server side where Jersey is managing the routes: @Configuration @EnableWebSocket public class WebSocketConfig extends…
Noam
  • 1,018
  • 7
  • 18
7
votes
3 answers

Websocket keep track of connections in Spring

Today I've searched a couple of hours for an implementation or tutorial in how to keep track of websocket connections in Spring. I've done the (very good) Spring tutorial about websockets and STOMP. link here So what's my setup, I have an Ionic…
Sytham
  • 824
  • 3
  • 11
  • 25
7
votes
2 answers

Java SockJS Spring client and message size

Using SockJS java client, I am trying to connect to Spring sockjs server and is getting error 1009 for messages (without headers) of ~20Kb. Javascript library works fine. Transport closed with CloseStatus[code=1009, reason=The decoded text message…
onkami
  • 8,791
  • 17
  • 90
  • 176
7
votes
2 answers

get native header when a user connects

I have clients connecting like this on a websocket var socket = new SockJS(this.props.stomp); var stompClient = Stomp.over(socket); var channel = "/room."+this.props.room.uid var app = this; stompClient.connect({room: this.props.room.uid},…
Luiz E.
  • 6,769
  • 10
  • 58
  • 98
7
votes
2 answers

Spring 4 WebSocket + sockJS:. Getting "No matching method found" in trace and @MessageMapping handler not invoked

Controller code: @Controller public class SockController { @MessageMapping(value="/chat") public void chatReveived(Message message, Principal principal) { ... LOGGER.debug("chatReveived message [{}]", message); ... …
user3908406
  • 1,416
  • 1
  • 18
  • 32
7
votes
2 answers

Spring Websocket and 404 status on connection

In a working Spring MVC 4.0.2 project running under Tomcat 7.0.50, I'm trying to implement Spring Websocket with simple broker and sockjs stomp endpoint, following the official reference. So, in the contextConfigLocation (DistpacherServlet property)…
user3328277
  • 73
  • 1
  • 1
  • 4
7
votes
1 answer

SockJS - '/info' causing Http 404 while connecting server

I've mainly followed below posts for implementing push notifications using SockJS, Push Notifications for Java Webapp, SockJS Client, SockJS Java Server. My sockJS client is: var sock = new SockJS("http://localhost:8080/pusher"); sock.onmessage =…
masT
  • 804
  • 4
  • 14
  • 29
6
votes
2 answers

The HTTP response from the server [200] did not permit the HTTP upgrade to WebSocket

I have my websocket client developed in STOMP Java client (Spring project) and server implemented in Spring boot. When the client/server handshake happens, I am getting a connection upgrade issue. Java Client Code List transports = new…
Mohan
  • 61
  • 1
  • 1
  • 4
6
votes
1 answer

Spring Boot + Spring Web Socket + RabbitMQ Web STOMP

I am working on adding live notification in my application I have done POC with - Spring Boot - Spring WebSocket - SockJS - RabbitMQ STOMP plugin I read about RabbitMQ Web STOMP and want to do POC of that. But it says Since version 3.7 support for…
n.sharvarish
  • 1,423
  • 4
  • 13
  • 13
6
votes
2 answers

How to use Spring Security with Spring Websocket support but without STOMP?

I'm currently Building a web application that uses Spring to leverage websocket Support and security. The thing is, I don't want to use STOMP. It has not been updated for about 4 yours now and I don't need it. So I followed the answer to another…
Fencer
  • 1,026
  • 11
  • 27