Skip to main content

Questions tagged [spring-websocket]

A Spring Framework module that support WebSocket-style messaging in web applications (native websocket and with SockJS support), including use of STOMP as an application level WebSocket sub-protocol.

spring-websocket
105 votes
6 answers
88k views

Sending message to specific user on Spring Websocket

How to send websocket message from server to specific user only? My webapp has spring security setup and uses websocket. I'm encountering tricky problem trying to send message from server to specific ...
gerrytan's user avatar
  • 40.9k
98 votes
3 answers
37k views

What are the pitfalls of using Websockets in place of RESTful HTTP?

I am currently working on a project that requires the client requesting a big job and sending it to the server. Then the server divides up the job and responds with an array of urls for the client to ...
smuggledPancakes's user avatar
96 votes
4 answers
74k views

How WebSocket server handles multiple incoming connection requests?

According to here: The HTTP Upgrade header requests that the server switch the application-layer protocol from HTTP to the WebSocket protocol. The client handshake established a HTTP-on-TCP ...
smwikipedia's user avatar
  • 63.4k
79 votes
3 answers
134k views

Shall I use WebSocket on ports other than 80?

Shall I use WebSocket on non-80 ports? Does it ruin the whole purpose of using existing web/HTTP infrastructures? And I think it no longer fits the name WebSocket on non-80 ports. If I use WebSocket ...
smwikipedia's user avatar
  • 63.4k
49 votes
5 answers
31k views

Does Spring @SubscribeMapping really subscribe the client to some topic?

I am using Spring Websocket with STOMP, Simple Message Broker. In my @Controller I use method-level @SubscribeMapping, which should subscribe the client to a topic so that the client would receive the ...
Mert Mertce's user avatar
  • 1,634
46 votes
5 answers
41k views

Spring WebSocket @SendToSession: send message to specific session

Is it possible to send a message to specific session? I have an unauthenticated websocket between clients and a Spring servlet. I need to send an unsolicited message to a specific connection when an ...
Tobia's user avatar
  • 9,380
45 votes
3 answers
28k views

Where "user" comes from in convertAndSendToUser works in SockJS+Spring Websocket?

I would like to understand how convertAndSendToUser works in Spring SockJS+Websocket framework. In client, we would connect as stompClient.connect(login, password, callback()) which will result in ...
onkami's user avatar
  • 9,161
39 votes
6 answers
83k views

I get a status 200 when connecting to the websocket, but it is an error?

My error shows up in the console of my browser: "WebSocket connection to 'ws://localhost:32768/DspClusterWebServices/myHandler' failed: Unexpected response code: 200" I am using Spring Websockets 4....
smuggledPancakes's user avatar
39 votes
5 answers
53k views

Spring WebSocket: Handshake failed due to invalid Upgrade header: null

I am using wss (secured web sockets) with spring from backend and STOMP for javascript client. Does anyone knows why a get: Handshake failed due to invalid Upgrade header: null
mspapant's user avatar
  • 1,930
36 votes
2 answers
12k views

How to reject topic subscription based on user rights with Spring-websocket

I'm implementing a version of the stock application where the server able to reject topic subscription for certain topic based on the user rights. Is there a way in spring-websocket to do this? For ...
tomikiss's user avatar
  • 969
36 votes
7 answers
39k views

Disconnect client session from Spring websocket stomp server

I've searched quite a bit and been unable to find this: Is there a way that a spring websocket stomp server can disconnect a client based on the sessionId (or really based on anything at all)? It ...
user1751547's user avatar
  • 2,311
34 votes
2 answers
49k views

How to send message to client through websocket using Spring

I try to use Spring with websocket. I started my investigation with this tutorial. In my side client I have something like that to initialize the connection to the server : function connect() { ...
cheb1k4's user avatar
  • 2,356
33 votes
3 answers
20k views

Spring Websocket in a tomcat cluster

In our current application, we use Spring Websockets over STOMP. We are looking to scale horizontally. Are there any best practices on how we should handle websocket traffic over multiple tomcat ...
Robin Varghese's user avatar
32 votes
6 answers
40k views

Spring Boot Websockets in Wildfly

Hi I need to deploy my Spring Boot app into Wildfly 8.1 and I'm getting the following exception: Caused by: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket....
Chris Stier's user avatar
31 votes
4 answers
14k views

Connect with iOS and Android clients to SockJS Backend

I'm developing WebSocket messaging backend using Spring WebSockets, which uses SockJS + STOMP protocol. The reason why not to use plain WebSockets is because I will need to leverage security ...
Maksim's user avatar
  • 16.8k

15 30 50 per page
1
2 3 4 5
99