V
V
Vadim Bakhtin2016-07-04 20:36:22
PHP
Vadim Bakhtin, 2016-07-04 20:36:22

What is the best way to work with websockets?

I need advice, there is a website, everything is written in php, but now I need it in websockets, I don’t really understand them, but I think I’ll figure it out along the way, now I want to ask you to tell me the right way, tell me about the pitfalls and what rake better not to attack.

Actually, web sockets are needed only for monitoring new posts on forum threads. Is it normal if I have a LEMP site (forum) on one server, and Node.js + socket.io on another server, and from the first server I will send requests to the second and receive responses? Will everything work fine? Or is it better to write everything on one server? I just don’t want to deal with sockets in php, and I would rather make 2 servers, I need to understand what are the disadvantages of this solution and what solution is the most optimal (for my task) in your opinion?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2016-07-04
@Sanasol

> appeared needed in websockets
> I don't really understand them
How did you understand that you need WS if you don't understand.
Use ajax.

V
Victor, 2016-07-28
@Levhav

Perhaps my saas project of the comet-server.ru server will help you, it simplifies the work with web sockets as much as possible and maintains open connections, thereby also unloading your hosting https://habrahabr.ru/company/comet-server/blog/273573/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question