spring-websocket

How WebSocket server handles multiple incoming connection requests?

旧巷老猫 提交于 2019-11-26 12:52:27
问题 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 connection between IE10 and server. After the server returns its 101 response, the application-layer protocol switches from HTTP to WebSockets which uses the previously established TCP connection. HTTP is completely out of the picture at this point. Using the lightweight WebSocket wire protocol, messages

Sending message to specific user on Spring Websocket

跟風遠走 提交于 2019-11-26 02:51:41
问题 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 user only . My understanding from reading the manual is from the server we can do simpMessagingTemplate.convertAndSend(\"/user/{username}/reply\", reply); And on the client side: stompClient.subscribe(\'/user/reply\', handler); But I could never get the subscription callback invoked. I have