I have test it with these components: http://websockets.esegece.com/
The Server is only a component.
In Servermodule -Customfiles i add this line: http://127.0.0.1:12345/sgcWebSockets.js In Mainform SCRIPT add the script
<script> var socket = new sgcWebSocket('ws://127.0.0.1:12345'); socket.on('open', function(event) { console.log('OPEN'); }); socket.on('close', function(event) { ajaxRequest(MainForm.window,'Closed', []); }); socket.on('error', function(event) { ajaxRequest(MainForm.window,event.message, []); }); socket.on('message', function(event) { ajaxRequest(MainForm.window,event.message, []); }); </script>
Now i get the event.message in Mainform OnAjaxEvent
Thats all, it works very well, hope it helps.