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
1,479
questions
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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
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 ...
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 ...
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() {
...
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 ...
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....
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 ...