Answer the question
In order to leave comments, you need to log in
Are you working with Node.JS and WebSockets?
I am newbie. I plan to write web applications using JS both on the client side and on the server side (no PHP). It is important to understand how to communicate in real time between the application and the server. WebSockets technology seems to exist, but is it not clear whether it is alive or dead? In real good projects without crutches with flash WebSockets is used or not? You are using? What about security (substitution for a proxy)?
Answer the question
In order to leave comments, you need to log in
Use Socket.io / Faye / Sock.js , these technologies will allow you to transparently work with clients that support websocket and those that do not. At the same time, in the code of your application, work with such clients will occur in the same way.
Everything is alive, feel free to use it, and it is already natively supported everywhere, of course there are features, and the main problem in the node when working with WebSockets is that they are not bothered to hang them on a separate port, on 81, 8080, etc. instead of making routes inside 80 potra and sorting by URL, like / is the page, /api/method is the API, and /ws is the socket connection. As a result, then the port is closed somewhere, and when scaling, there is an extra setting, and to make many different connections (rooms, message buses, notification channels) with this approach, multiplying open ports is not an option, it’s better to get confused and figure out the routing and integration of it on port 80. I decided everything for myself a long time ago and comprehensively by implementing WebSockets support in the application server - habrahabr.ru/post/247543
websockets + fallback in long pooling. Node.js acts as just a push server usually, and in any case, all the heavy stuff (authentication, authorization, direct actions) is taken out to the main application (in php, js or whatever) and connected by a data bus to which queue manager or redis .
Для надежности все соединения проксируются через haproxy/nginx.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question