From 32285ee35ab36f60e49a6911a279f037357a8e02 Mon Sep 17 00:00:00 2001 From: rshiv Date: Tue, 16 Nov 2021 10:51:05 +0000 Subject: [PATCH] Adds readme for websockets (#768) * test_fleet Signed-off-by: rshiv * add readme for websockets Signed-off-by: rshiv * add readme Signed-off-by: rshiv * add readme Signed-off-by: rshiv * review comment fix Signed-off-by: rshiv * Update waku/v2/README.md Co-authored-by: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com> * Update waku/v2/README.md Co-authored-by: Jakub Co-authored-by: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com> Co-authored-by: Jakub --- waku/v2/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/waku/v2/README.md b/waku/v2/README.md index bab652d80..e6e9739b1 100644 --- a/waku/v2/README.md +++ b/waku/v2/README.md @@ -134,3 +134,24 @@ You can change this to `wakunode2`, the Waku v2 node like this: make docker-image MAKE_TARGET=wakunode2 docker run --rm -it statusteam/nim-waku:latest --help ``` +## Using Websocket and secure Websockets + +Websocket support is hidden under a feature flag and must be explicitly enabled in order to get Websockets support. The default port is 8000. + +``` +# Run unsecure Websockets (doesn't require a certificate) +./build/wakunode2 --websocket-support=true +``` + +Running a secure websocket requires an ssl certificate. We can create a self signed websocket. However, it requires the `openssl` utility. It can be achieved with: + +``` +mkdir -p ../ssl_dir/ + +openssl req -x509 -newkey rsa:4096 -keyout ../ssl_dir/key.pem -out ../ssl_dir/cert.pem -sha256 + +./build/wakunode2 --websocket-secure-support=true --websocket-secure-key-path="../ssl_dir/key.pem" --websocket-secure-cert-path="../ssl_dir/cert.pem" +``` + + +