A
A
Artyom2020-02-13 07:21:10
Web development
Artyom, 2020-02-13 07:21:10

What is the best way to create a general chat and private messages on your site?

Good day to all!
I got a little confused when looking for an answer and decided that it would be right to ask a question to those who know)

In general, I am building a website and I need to implement two chats and private messages with admins (separate from chats). Of all the things I've found, sockets are the best to use in combination with php and tables.

It is worth noting that before that I unknowingly made comments for another project that were updated every 10 seconds (setTimeout). I did not just update all the comments, but read their number from the one in the database, and if they differed, uploaded the latest ones to the site. As for me, it's very crutch. Therefore, for a new project, I decided to look for other options.

Stumbled on the sockets and rushed. As far as I understand there are several solutions:

  1. WebSocket protocol . Used simply in conjunction with jq/php
  2. SOCKET.IO . It already needs node.js
  3. workerman library . Used in conjunction with WebSocket

I apologize for the mess in my head, but still. Is regular hosting enough for all of the above to work or is it worth buying a server (VPS)?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question