4 <meta charset=utf-8 http-equiv="Content-Language" content="en"/>
5 <link rel="stylesheet" type="text/css" href="test.css"/>
6 <script type='text/javascript' src="/lws-common.js"></script>
7 <script type='text/javascript' src='test.js'></script>
8 <title>Minimal Websocket test app</title>
19 <td valign=middle align=center>
20 <a href="https://libwebsockets.org">
21 <img src="libwebsockets.org-logo.svg"></a></td><td>
22 <section class="browser">
23 <div id=brow>...</div></section>
25 <td width="64" height="64" id="wstransport"></td>
26 <td width="64" height="64" id="transport"></td>
31 <tr><td colspan=2 align=center>
32 Click <a href="leaf.jpg" target="_blank">Here</a> to
33 have the test server send a big picture by http.
39 <input type="radio" id="tab-1" name="tab-group-1" checked>
40 <label for="tab-1">Dumb Increment Demo</label>
43 <div id="dumb" class="group2">
46 <td id=wsdi_statustd align=center class="wsstatus">
47 <span id=wsdi_status>Websocket connection not initialized
49 <td><span class="title">dumb increment-protocol</span></td>
52 <td class="explain" colspan=2>
53 The incrementing number is coming from the server at 20Hz and is individual for
54 each connection to the server... try opening a second browser window.
56 The button sends a message over the websocket link to ask the server
57 to zero just this connection's number.
61 <td align=center><div id=number class="bigger"> </div></td>
63 <input type=button id=offset value="Reset counter">
64 <input type=button id=junk value="Send junk">
73 <input type="radio" id="tab-2" name="tab-group-1">
74 <label for="tab-2">Mirror Demo</label>
77 <div id="mirror" class="group2">
80 <td colspan=1 id=wslm_statustd align=center class="wsstatus">
81 <span id=wslm_status>Websocket connection not initialized</span>
84 <span class="title">lws-mirror-protocol</span>
90 Use the mouse to draw on the canvas below -- all other browser windows open
91 on this page see your drawing in realtime and you can see any of theirs as
94 The lws-mirror protocol doesn't interpret what is being sent to it, it just
95 re-sends it to every other websocket it has a connection with using that
96 protocol, including the guy who sent the packet.
98 <b>libwebsockets-test-client</b> joins in by spamming circles on to this
99 shared canvas when run.
104 <td colspan=2>Drawing color:
106 <option value=#000000>Black</option>
107 <option value=#0000ff>Blue</option>
108 <option value=#20ff20>Green</option>
109 <option value=#802020>Dark Red</option>
113 <td colspan=2 width=500 height=320>
114 <div id="wslm_drawing" class="bgw"></div>
123 <input type="radio" id="tab-3" name="tab-group-1">
124 <label for="tab-3">Close Testing</label>
126 <div class="content">
127 <div id="ot" class="group2">
133 <tr><td id=ot_statustd align=center class="wsstatus">
134 <span id=ot_status>Websocket connection not initialized</span>
136 <td colspan=2><span class="title">Open and close testing
140 <td class="explain" colspan=3 >
141 To help with open and close testing, you can open and close a connection by
142 hand using the buttons.<br>
143 "<b>Close</b>" closes the connection from the browser with code 3000
144 and reason 'Bye!".<br>
145 "<b>Request Server Close</b>" sends a message asking the server to
146 initiate the close, which it does with code 1001 and reason "Seeya".
150 <input type="button" id="ot_open_btn" value="Open"></td>
152 <input type="button" id="ot_close_btn" disabled value="Close" ></td>
154 <input type="button" id="ot_req_close_btn" disabled
155 value="Request Server Close" ></td>
165 <input type="radio" id="tab-4" name="tab-group-1">
166 <label for="tab-4">Server info</label>
168 <div class="content">
169 <div id="ot" class="group2">
172 <td id=s_statustd align=center class="wsstatus">
173 <div id=s_status>Websocket connection not initialized</div>
176 <span class="title">Server Info</span>
177 <input type=button id=pmd value="Test pmd">
181 <td class="explain" colspan=2>
182 This information is sent by the server over a ws[s] link and updated live
183 whenever the information changes server-side.
186 <td align=center colspan=2><div id=servinfo></div></td>
189 <td align=center colspan=2><div id=conninfo class="conninfo"></div></td>
197 <input type="radio" id="tab-5" name="tab-group-1">
198 <label for="tab-5">POST</label>
200 <div class="content">
201 <div id="ot" class="group2">
205 <span class="title">POST Form testing</span>
208 <td class="explain" colspan=2>
209 This tests POST handling in lws.
212 <td align=center colspan=2 class=tdform><div id=postinfo>
213 FORM 1: send with urlencoded POST body args<br>
214 <form action="formtest" method="post">
215 <span class="f12">Some text: </span>
216 <input type="text" name="text" value="Give me some text"><br>
217 <input type="submit" name="send" value="Send the form">
224 <td align=center colspan=2 class=tdform><div id=postinfo >
225 FORM 2: send with multipart/form-data<br>
226 (can handle file upload, test limited to 100KB)<br>
227 <form name=multipart action="formtest" method="post"
228 enctype="multipart/form-data">
229 <span class="f12">Some text: </span>
230 <input type="text" name="text" value="Give me some text">
232 <input type="file" name="file" id="file" size="20">
233 <span id=file_info class="f12"></span><br>
234 <input type="submit" id="upload" name="upload" disabled=1 value="Upload">
248 <a href="https://libwebsockets.org">https://libwebsockets.org</a>,
249 <a href="https://github.com/warmcat/libwebsockets">
250 https://github.com/warmcat/libwebsockets</a></a><br/>
251 Join the mailing list:
252 <a href="https://libwebsockets.org/mailman/listinfo/libwebsockets">
253 https://libwebsockets.org/mailman/listinfo/libwebsockets</a>