summaryrefslogtreecommitdiff
path: root/README
blob: 5849d5063e2f284c8741cf90189788eb969bd36f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-*- mode: org -*-

Guile-WebSocket is an implementation of the WebSocket protocol as
defined by [[https://tools.ietf.org/html/rfc6455][RFC 6455]].

* Test it out

Run the example server:

#+BEGIN_SRC sh
  GUILE_LOAD_PATH="$PWD:$GUILE_LOAD_PATH" guile test.scm
#+END_SRC

Then, open a web browser and run the following in the JavaScript
console:

#+BEGIN_SRC javascript
  var ws = new WebSocket("ws://localhost:9090");

  ws.onmessage = function(message) {
    console.log(message.data);
  };

  ws.send("hello, there!")
#+END_SRC

If everything works, "!ereht ,olleh" will be written to the JavaScript console.