There is a script in php working with WebSocket, as he wrote himself at the time of writing there was no ready-made solutions
initialization:
$host = '192.168.10.225'; //host
$port = '3994'; //port
//Create TCP/IP sream socket
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
//reuseable port
socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1);
//bind socket to specified host
socket_bind($socket, 0, $port);
//listen to port
socket_listen($socket);
And the client code (His warp over WebSocket):
Socket.bind('open', function () {
Socket.send({ name: 'alex', status: 'online' });
});
Socket.init("ws://192.168.10.225:3994/shell/rest.sock.php");
...
var Socket = (function(){
var socket;
var self = {
init: function(host){
socket = new WebSocket(host);
socket.onopen = function(e){ callEventList('open', e) };
socket.onmessage = function(e){ callEventList('message', e) };
socket.onclose = function(e){ callEventList('close', e) };
},
send: function (msg) {
...
Works everywhere: chrome / opera / ie / android / ios
But when trying to connect to the Windows store app js, produces an error:
SCRIPT12029: WebSocket Error: Network Error 12029, Unable to communicate with the server
Which is strange because The same code works ie
Prompt where it may be a mistake to look for and where?
Sorry for my eng...