WebSockets in ePHPm, From Zero to a Working Chat
How to run WebSockets in ePHPm with a single PHP file. It covers turning them on, sharing the login session, pushing messages from normal HTTP requests, serving over TLS and the limits to know about.
I covered the design of ePHPm’s native WebSockets in a few paragraphs of the odds
and ends post. Rust owns the socket and PHP runs once per event. An idle
connection never costs you a PHP thread. That was the why. This post is the how. We’ll build a small chat app with
login, per-user push notifications from ordinary HTTP requests and a browser client. Then we’ll serve it over TLS.
Last come the limits, the sharp edges and how to debug it when the browser only tells you 1006.
