Skip to content

Commit

Permalink
Tweaks to ws demo
Browse files Browse the repository at this point in the history
  • Loading branch information
samdutton committed Dec 18, 2016
1 parent b1192dd commit e2dfa2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions websockets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<base target="_blank">
<title>WebSockets</title>
<title>WebSocket</title>
<link rel="stylesheet" href="../css/main.css" />

<style>
Expand Down Expand Up @@ -82,17 +82,19 @@
<body>
<div id="container">

<h1><a href="../index.html" title="simpl.info home page">simpl.info</a> websockets</h1>
<h1><a href="../index.html" title="simpl.info home page">simpl.info</a> WebSocket</h1>

<p>A WebSocket connection is established with the server and kept open. The server will echo the sent message.</p>
<p>Enter a server URL and tap/click the <strong>Connect</strong> button to establish a WebSocket connection.</p>

<p>More info can be found at <a href="https://www.websocket.org/" title="websocket.org">websocket.org</a></p>
<p>This connection will remain open. Enter text, tap/click the <strong>Send</strong> button and the WebSocket server will echo the sent message.</p>

<p>More info can be found at <a href="https://www.websocket.org/" title="websocket.org">websocket.org</a>.</p>

<div id="inputOutput">

<div class="input">
<label for="serverInput">Server</label>
<input id="serverInput" type="text" value="wss://echo.websocket.org/">
<input id="serverInput" type="text" value="wss://echo.websocket.org">

<button id="connectButton">Connect</button>
<button id="disconnectButton" disabled>Disconnect</button>
Expand Down
2 changes: 1 addition & 1 deletion websockets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function clickDisconnect() {
}

function clickSend() {
logMessage('send', 'Send: ' + textInput.value);
logMessage('send', 'Sent: ' + textInput.value);
ws.send(textInput.value);
}

Expand Down

0 comments on commit e2dfa2f

Please sign in to comment.