Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share real time updates on a website between users on different computers?

I'm trying to figure out a way for users of a website (say a student and teacher) to share a secure connection where real time updates on one page are viewed by both of them. From research I've concluded that some of the real time updates could be performed using ajax and javascript.

But I'm stumped as to how users could share a connection where only the two users would be viewing the updates that take place on the website (such as flash animations of a drawing board.) I'm also confused how you would even begin to set up a connection like this.

I've looked intp php sessions and cookies but I'm not sure I'm doing the right research. Any pointers as to how two specific users could share a secure connection where real time updates are viewed by the both of them only. I don't want a terse response please. I'm looking for specific details like functions and syntax specific to php. I appreciate the help and will rate you up if you give me good answers!

like image 576
user1402072 Avatar asked Nov 13 '22 05:11

user1402072


1 Answers

You cannot share a secure connection (e.g. HTTPS) its one client to one server.

If both clients are logged in and have a background AJAX task running in the browser, is it acceptable to have each client "pull" every few seconds the same data to display for both users?

This would require the "drawing board" updates to also be sent continuously back to the server to share the updated data with the other client. I'm sure there will be an event you can use to trigger the post of data (e.g. on mouse up).

If performance is an issue, you'd want to use a better server technology like Java that is able to keep session state between requests without having to persist to a database.

like image 55
Brad Avatar answered Nov 16 '22 04:11

Brad