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: " + evt.data); };
myWebSocket.onclose = function(evt) { alert("Connection closed."); }; //This line is always true
</script>
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");
(Ref:http://www.tutorialspoint.com/html5/html5_websocket.htm)