Wednesday, April 13, 2022

[FIXED] What is the best way to make instant messaging on website?

Issue

I am currently creating a website on Symfony 4, and I would like to integrate an instant messaging system like messenger, with the possibility to create groups of discussions.

The problem is that I don't know which method to use. Symfony doesn't offer anything for that, and ajax seems to me not optimized at all because of the many requests made to the server. Should I use websockets coupled to nodeJs? Or use the Rachet librarie? Because I don't know NodeJs and integrate a new technology into the project may not be suitable for everyone

So, what would be the most optimized system to support a large number of users?

Thank you,


Solution

You have 2 options here:

Implement by yourself

In your case you need the following:

  • Install some XMPP server in your cloud. It could be something like Ejabberd, Prosody, Tigase, Openfire
  • On client side - use XMPP libs to connect to XMPP server and to send/receive messages. On Web/Web panel - use StropheJS
  • for any service tasks - there are also XMPP libs for PHP

Use some messaging SaaS platforms

There are also lot's of diff messaging platforms e.g Pusher, Twillio, Layer, ConnectyCube, Applozic etc.

I used ConnectyCube some time ago, they support Messaging, Video Calling and Push Notifications functionality for iOS, Android and Web. They also have some ready code samples available, so can some some time on start. Pricing is a competitive one. So it can be done in the following way:

Hope it will be helpful for you



Answered By - Rubycon
Answer Checked By - Katrina (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.