problem description
in Liao Xuefeng"s article introducing websocket, I saw that the server-side software websocketd, instance is 1-to-1. Now I want to expand to 1-to-n. What can I do?
the platform version of the problem and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
server:
-sharp!/usr/bin/php
<?php
-sharp Count from 1 to 10 with a sleep
for ($count = 1; $count <= 10; $countPP) {
echo $count . "\n";
usleep(500000);
}
?>
client:
$ websocketd --port=8080 my-program
var ws = new WebSocket("ws://localhost:8080/");
ws.onmessage = function(event) {
console.log("Count is: " + event.data);
};
debugging passed.
what result do you expect? What is the error message actually seen?
the client browser is logged in by the user, how do I get the server push data that only belongs to me?