Real-time PHP sandbox
cd backend composer install cd .. docker-compose up
This runs apache server and local poxa instance.
Idea of this sandbox
add.html file sends text to
add.php script whenever text in textarea changes. The script saves text into
local filesystem and notifies Pusher and local poxa instance about this.
All other files in
/backend folders are for demonstrating different synchronisation mechanisms
Google chrome was used for testing.
Server sent events
Pusher and poxa (WebSockets)
authentication.html file demonstrates
private- channel support for Pusher and poxa with authentication
hook in backend.
marius and press
Subscribe, then edit text for test to work.
Authentication logic is inside
backend/pusher-auth.php. This is just simple example, you should check if
JWT token is present, active session exists or user has some kind of cookie - just use your common authentication
flows for this.
Make sure you check not only if user is logged in, but if s/he has access to specified channel.