2 8sync --- Asynchronous programming for Guile
3 Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 This file is part of 8sync.
7 8sync is free software: you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 3 of the
10 License, or (at your option) any later version.
12 8sync is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with 8sync. If not, see <http://www.gnu.org/licenses/>.
23 <title>Ws test</title>
28 var server = "ws://localhost:1236";
29 var log = document.getElementById ("log");
30 console.log ('log=%j', log);
31 console.log ('document=%j', document);
32 console.log ('body=%j', document.body);
33 var ws = new WebSocket (server);
34 ws.onopen = function () {
35 console.log ('open!'); log.innerHTML += 'open!<br>';
36 ws.send ('Hello, Web Socket!');
37 ws.send ('Say: ' + 'A'.repeat (Math.pow (2, 16)) + '\n');
39 ws.close = function () { console.log ('close!'); log.innerHTML += 'close!<br>'; };
40 ws.onmessage = function () { console.log ('message'); log.innerHTML += 'message!<br>'; };