I am trying to subscribe to a particular channel in spring web sockets but while pointing to a URL using SockJs
i getting the following error WebSocket connection to 'ws://localhost:8080/Spring/rest/user/chat/045/jmfz3b3j/websocket' failed: Error during WebSocket handshake: Unexpected response code: 200
Please help me to avoid this.
Here is my client side code for subscription.
Index.jsp
var stompClient =null;
function subscribe(){
var socket = new SockJS('/Spring/rest/user/chat');
stompClient = Stomp.over(socket);
stompClient.connect({}, function(frame) {
console.log('Connected: ' + frame);
stompClient.subscribe('/topic/messages', function(test) {
alert("in call back function");});
});
}