Javascript examples for Language Basics:WebSocket
Create HTML5 Websocket Server
<html> <head> <script type="text/javascript"> var socket = new WebSocket('ws://localhost:8080/websession'); socket.onopen = function() { console.log('handshake successfully established. May send data now...'); };/*w ww . j av a 2s. c o m*/ socket.onclose = function() { console.log('connection closed'); }; </script> </head> <body> </body> </html>