From 2d7016ede2d7e4c123495e1f4aef92c5567c5922 Mon Sep 17 00:00:00 2001 From: Hendrik Eeckhaut Date: Mon, 6 May 2024 10:47:22 +0200 Subject: [PATCH] doc: use websocat instead of websockify in quickstart (#49) * doc: use websocat instead of websockify in quickstart * Update quickstart.md Co-authored-by: Christopher Chong * Update readme.md Co-authored-by: Christopher Chong --------- Co-authored-by: Christopher Chong --- quickstart.md | 18 +++++++++++++----- readme.md | 22 +++++++++++++++------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/quickstart.md b/quickstart.md index 89ec62f..c1272d1 100644 --- a/quickstart.md +++ b/quickstart.md @@ -8,14 +8,22 @@ There is a simple react/typescript demo app in `./demo/react-ts-webpack`. The di Since a web browser doesn't have the ability to make TCP connection, we need to use a websocket proxy server. -To run your own websockify proxy **locally**, run: +To run your own websocket proxy for `https://swapi.dev` **locally**: + +1. Install [websocat](https://github.com/vi/websocat): + + | tool | command | + |--------|-------------------------------| + | cargo | `cargo install websocat` | + | brew | `brew install websocat` | + | source | https://github.com/vi/websocat| + +2. Run a websocket proxy for `https://swapi.dev`: ```sh -git clone https://github.com/novnc/websockify && cd websockify -./docker/build.sh -docker run -it --rm -p 55688:80 novnc/websockify 80 swapi.dev:443 +websocat --binary -v ws-l:0.0.0.0:55688 tcp:swapi.dev:443 ``` -Note the `swapi.dev:443` argument on the last line, this is the server we will use in this quick start. +Note the `tcp:swapi.dev:443` argument on the last line, this is the server we will use in this quick start. ### Run a Local Notary Server diff --git a/readme.md b/readme.md index 99dc831..f805b03 100644 --- a/readme.md +++ b/readme.md @@ -2,10 +2,10 @@ NPM Modules for proving and verifying using TLSNotary in the browser. -The prover requires a [notary-server](https://github.com/tlsnotary/notary-server) and websockify proxy +The prover requires a [notary-server](https://github.com/tlsnotary/notary-server) and a websocket proxy > [!IMPORTANT] -> `tlsn-js` is developped for the usage of TLSNotary **in the Browser**. This module does not work in `nodejs`. +> `tlsn-js` is developed for the usage of TLSNotary **in the Browser**. This module does not work in `nodejs`. ## Example ```ts @@ -30,11 +30,19 @@ const result = await verify(proof); console.log(result); ``` -## Running a local websockify proxy for `https://swapi.dev` -``` -git clone https://github.com/novnc/websockify && cd websockify -./docker/build.sh -docker run -it --rm -p 55688:80 novnc/websockify 80 swapi.dev:443 +## Running a local websocket proxy for `https://swapi.dev` + +1. Install [websocat](https://github.com/vi/websocat): + + | tool | command | + |--------|-------------------------------| + | cargo | `cargo install websocat` | + | brew | `brew install websocat` | + | source | https://github.com/vi/websocat| + +2. Run a websocket proxy for `https://swapi.dev`: +```sh +websocat --binary -v ws-l:0.0.0.0:55688 tcp:swapi.dev:443 ``` ## Install as NPM Package