My site will need to use the following features.

  1. In the case of private messages that would appear information (about how I facebook)
  2. General chat.
  3. When the price of goods changes by the seller, the price changes
  4. Personal chat

How to implement it? Use json and if? Or by using multiple websocket. If there are examples on solutions, links are welcome.

Closed due to the fact that the question is too common for the participants D-side , Streletz , aleksandr barakin , Athari , user194374 Jun 29 '16 at 5:58 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Ajax Pomoymu more suitable - Naumov
  • one
    reactphp.org , socketo.me . GOOGLE? - E_p
  • Please try to express your thoughts more clearly and clearly. Start sentences with a capital letter, use punctuation marks. Now your question is quite difficult to read and understand and it reduces the chances of getting a good answer. - Nick Volynkin
  • one
    @NickVolynkin corrected - Sergalas

1 answer 1

Chat can be implemented on node.js a lot of manuals, exchange messages in json. In json, you can create a type_msg field. If the value is public, then the message is in general chat, if private, then the message is private, in this case we give id — to which we will send the message, and when implementing an array of active users, insert it with the user id index. Price changes can be displayed by a pop-up message.

  • That is json and if - Sergalas
  • Yes, not necessarily if you can switch)) - Sergey Zelensky
  • I'm not talking about the performance of the principle. And you can not run together? - Sergalas
  • possible, it all depends on the implementation - Sergey Zelensky
  • The question is whether it is possible to launch several websocet servers on one site - Sergalas