Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Super simple PHP WebSocket example - websockets.html
<div id="root"></div>
var host = 'ws://';
var socket = new WebSocket(host);
socket.onmessage = function(e) {
document.getElementById('root').innerHTML =;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment