W
W
What1slov32020-10-18 02:54:27
Node.js
What1slov3, 2020-10-18 02:54:27

Messenger API, REST + WS or pure WebSocket?

The essence of the issue is this, I decided to download the messenger for the sake of interest, several technological issues immediately arose.
One of them is how to build an API?
Is it worth mixing REST for state management (by type, change user data, authorization, get profile data, etc.) and WebSocket for communication, of course.
Or is it worth doing everything on sockets at once?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Shumov, 2020-10-18
@inoise

You can combine, you can not combine. You can generally chat through long-polling

D
dooMoob, 2020-10-18
@dooMoob

Discord, for example, is mixed.
Most importantly, do not do pure http

X
xmoonlight, 2020-10-18
@xmoonlight

Just pure WebSocket with its additional point-to-point traffic encryption inside the WSS pipe. All service traffic (login/logout, states, etc.) is in the same place.
So that you can use messaging both on the web and in any native applications for different operating systems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question