I have recently joined a new project where I am being tasked with implementing streaming data using web sockets. The idea is a bunch of information is being exposed currently through HTTP requests (in a RESTful manner) that they want exposed through web sockets.
I have done a bunch of research in the past 48 hours about web sockets and STOMP and wanted to get some clarification on a few points:
So for a client and a server to connect via a web socket rather than through an HTTP request/response, they first need to agree to set up a web socket connection between them. Is this done through HTTP GET with a unique header passed that says they are to use a web socket connection instead?
Theoretically, say that there is a whole bunch of different data being exposed through some API to the browser. Imagine there is a whole bunch of different HTTP requests that can be made GET'S, POST'S, DELETE whatever. So to have certain pieces of all this information be streamed via a web socket, is it simply to change the current GET request for each resource to check to see if that special websocket header is there and then do something? Or is there something else that has to be done to expose certain pieces of data through web sockets. I just may of misunderstood the relationship of HTTP and sockets if you initialize a socket from a HTTP request.
I think these are my two main questions and I am sure the answers to these will point me in the right direction to continue learning more about the topic. I am trying to find any good sample code examples but I am trying to understand this well enough to implement within the week.