• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

Understanding websocket example in spring

HI,
I am using hte websocket example on : https://spring.io/guides/gs/messaging-stomp-websocket/
when i click on the connect button on the web page which loads when this application code is run the following code executes :
function connect() {
    var socket = new SockJS('/gs-guide-websocket');
    stompClient = Stomp.over(socket);
    stompClient.connect({}, function (frame) {
        setConnected(true);
        console.log('Connected: ' + frame);
        stompClient.subscribe('/topic/greetings', function (greeting) {
            showGreeting(JSON.parse(greeting.body).content);
        });
    });
}

Open in new window


And i see the following two network calls in the Network tab of chrome :
http://localhost:8080/gs-guide-websocket/info?t=1474970676486
ws://localhost:8080/gs-guide-websocket/614/vbxj5iok/websocket

What do these mean and what are there purpose... what are the things in bold means and where did they come from ?


Thanks
0
Rohit Bajaj
Asked:
Rohit Bajaj
1 Solution
 
KimputerCommented:
When using a framework, api or other services that are meant to make things easy, you usually don't look under the hood too much. It's why you are using it in the first place, to make things easy for you.
In this case, you should check the request and the response (input name, get "hello name" back), if that's expected or not. Not really dig so deep as to what it's really sending in and out. The requests are all taken care of the backbone (in your case Spring.io), and the programmers could tell you the specifics but it would probably take quite some time for you to understand.
Usually it's a combination of time, randomness, and things to track.
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now