Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (38 sloc) 936 Bytes
<!doctype html>
<script type="text/javascript" src=""></script>
if ("WebSocket" in window) {
var ws = new WebSocket("ws://host_here:port_here/");
ws.onopen = function() {
$('#wait').html("you can type and hit enter. look at your console.")
return false;
ws.send("message to send");
ws.onmessage = function (evt) {
var m =;
$('#message').after("<div class='message'>"+m+"</div>")
ws.onclose = function() {
} else {
alert("No web socket support"); //flash alternative ?
<div id="wait">Waiting...</div>
Web socket
<form id="form" action="">
<input id="message">