<!DOCTYPE html>
<html lang="en">
<head>
	<title>WebSocket Client</title>
	<style>
		#output {
			border: solid 1px #000;
		}
	</style>
</head>
<body>
	
	<form id="form">
		<input type="text" id="message">
		<button type="submit">Send</button>
	</form>
	
	<hr>
	
	<div id="output"></div>
	
	<script>
	
		var inputBox = document.getElementById("message");
		var output = document.getElementById("output");
		var form = document.getElementById("form");
		try {
			//var host = "ws://" + window.location.hostname + ":9876/stuff";
                        var host = "ws://localhost:8765/echo";
			console.log("Host:", host);
			
			var s = new WebSocket(host);
			
			s.onopen = function (e) {
				console.log("Socket opened.");
			};
			
			s.onclose = function (e) {
				console.log("Socket closed.");
			};
			
			s.onmessage = function (e) {
				console.log("Socket message:", e.data);
				var p = document.createElement("p");
				p.innerHTML = e.data;
				output.appendChild(p);
			};
			
			s.onerror = function (e) {
				console.log("Socket error:", e);
			};
			
		} catch (ex) {
			console.log("Socket exception:", ex);
		}
		form.addEventListener("submit", function (e) {
			e.preventDefault();
			s.send(inputBox.value);
			inputBox.value = "";
		}, false)
	</script>

</body>
</html>

Add an additional test page.
Add an additional test page.
