my connection to WebSocket is getting Disconnected continuously. I'm working in folder realtime on localhost.
How to keep WebSocket connection live?

How to use WebSocket in javascript?

Link: http://localhost/realtime/

<script language="javascript" type="text/javascript">  

    var myWebSocket = new WebSocket("ws://localhost/realtime");

    myWebSocket.onopen = function(evt) { alert("Connection open ..."); }; 

    myWebSocket.onmessage = function(evt) { alert( "Received Message: " +; };

    myWebSocket.onclose = function(evt) { alert("Connection closed."); }; //This line is always true


How to insert data to 'generalposts' table id, post field using socket?

How to fetch data using socket from above table & fields?

I used this too var myWebSocket = new WebSocket("ws://localhost:8005/realtime"); and var myWebSocket = new WebSocket("ws://localhost:9998/realtime");


Any body please help me....!!!!!!!!

I've made list. How to implement following?

//create a new WebSocket object.
websocket = new WebSocket("ws://localhost:9000/realtime/demo.php");
websocket.onopen = function(evt) { /* do stuff / }; //on open event
websocket.onclose = function(evt) { /
do stuff / }; //on close event
websocket.onmessage = function(evt) { /
do stuff / }; //on message event
websocket.onerror = function(evt) { /
do stuff */ }; //on error event
websocket.send(message); //send method
websocket.close(); //close method

I have almost same problem dude

When a websocket connection gets disconnected it's usually because of an error with the websocket server. I would use an external provider like PushRadar to handle websocket connections.