diff --git a/examples/echo/README.md b/examples/echo/README.md index 14b5b09..6ad79ed 100644 --- a/examples/echo/README.md +++ b/examples/echo/README.md @@ -14,6 +14,4 @@ Next, start the client: $ go run client.go The server includes a simple web client. To use the client, open -http://127.0.0.1:8080 in the browser. Click "Open" to open a connection to the -server, "Send" to send a message to the server and "Close" to close the -connection. +http://127.0.0.1:8080 in the browser and follow the instructions on the page. diff --git a/examples/echo/server.go b/examples/echo/server.go index 53d21f6..a685b09 100644 --- a/examples/echo/server.go +++ b/examples/echo/server.go @@ -65,9 +65,9 @@ window.addEventListener("load", function(evt) { var ws; var print = function(message) { - var p = document.createElement("p"); - p.innerHTML = message; - output.appendChild(p); + var d = document.createElement("div"); + d.innerHTML = message; + output.appendChild(d); }; document.getElementById("open").onclick = function(evt) { @@ -112,13 +112,21 @@ window.addEventListener("load", function(evt) { + +
+

Click "Open" to create a connection to the server, +"Send" to send a message to the server and "Close" to close the connection. +You can change the message and send multiple times. +

+
+
`))