hhvm bin/chat-server.php
Open some JS Console, as Google Chrome console.
var conn = new WebSocket('ws://127.0.0.1:8080');
conn.onopen = function(e) {
console.log("Connection established!");
};
conn.onmessage = function(e) {
console.log(e.data);
};
Open another JS Console:
var conn = new WebSocket('ws://127.0.0.1:8080');
conn.onopen = function(e) {
console.log("Connection established!");
};
conn.onmessage = function(e) {
console.log(e.data);
};
conn.send('Hello World!');
Go back to the previous console and check the results :-)
Hi! How can I send message to only one client? Or how I can get access to $_SESSION and $_GET?