Ok, I've read a million tutorials and in the comments section there is always someone who is asking the same thing as what I am now experiencing and no real answer is given, And just to clarify, yes, im using latest version of chrome which websockets works on.
I keep getting the "Disconnected" error as soon as the page loads.
firstly im runnig PHP 5 on IIS (not my choice)
I have downloaded http://bohuco.net/dev/websocket/?source=WebSocketServer.php
and trying to test out http://www.flynsarmy.com/2010/05/php-web-socket-chat-application/.
The location of the files that I have downloaded are in www.something.co.uk/html5/test
which includes the demo files above and also the websocket php.
The thing that I am confused about is how //Connect to the server
var server = new ServerEventsDispatcher("<someip>:12345");
connects with the server.php located in file path above.
can I add the domain and URL in the someip part?
Any help on this is much appreciated.
EDIT
after some more reading it appears that I can.
http://dev.w3.org/html5/websockets/
var socket = new WebSocket('ws://game.example.com:12010/updates');
socket.onopen = function () {
setInterval(function() {
if (socket.bufferedAmount == 0)
socket.send(getUpdateData());
}, 50);
};
So my next question (as this still does not resolve the situation)
within the server.php file, is localhost valid or does it have to be ip/domain?
$server = new WebsocketServer('localhost', 12345, 'process');
EDIT
I have changed web socket connection to
//Connect to the server
var server = new ServerEventsDispatcher("domain.co.uk:81/path/to/server.php");
and changed the port in scripts.php to 81 and still nothing...