Answer the question
In order to leave comments, you need to log in
How is routing performed when working through websocket?
Good afternoon.
Tell me, how is routing done when working with web sockets?
When working with rest, the server is guided by uri. But a request. coming through the socket is just text. And I do not quite understand how to resolve this matter on the server? All examples of working with sockets on the network boil down to a chat that simply accepts a string and sends it to all clients.
I think that it is possible to send a serialized json to the server, where the route and parameters for it will be specified. In theory, there should be some generally accepted protocol for this?
I'm interested in the general logic of solving such a problem, but first of all I'm guided by scala.
Answer the question
In order to leave comments, you need to log in
I think you should pay attention to the wamp protocol - it is an add-on for websockets.
It helps to solve basic tasks, there are ready-made libraries in many languages. Well, if there is no library or for some reason it does not fit, you can write your own - the standard (especially the first version ) is very compact and simple.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question