Run on Linux:
- OpenLiteSpeed: /usr/local/lsws/lsphp73/bin/php /your-dir/wss.php &
- Apache: /usr/bin/php /your-dir/wss.php &
- Or: systemctl start phpWs.service (if change config and run file service_create.sh)
Run on Windows:
- Xampp: C:\xampp\php \your-dir\ws.php
Client using on Javascript:
<script type="text/javascript">
socketNotice = new WebSocket('wss://your-domain:8090');
socketNotice.onopen = function(response)
{
console.log(response);
}
socketNotice.onmessage = function(response)
{
console.log(response);
}
socketNotice.onclose = function(response)
{
console.log(response);
}
socketNotice.send(JSON.stringify({type: "status", action: "online", rid: '', receiver: [], msg: "", uid: "_my_id", uData: []}));
</script>