Skip to content

Commit

Permalink
doc: use websocat instead of websockify in quickstart (#49)
Browse files Browse the repository at this point in the history
* doc: use websocat instead of websockify in quickstart

* Update quickstart.md

Co-authored-by: Christopher Chong <[email protected]>

* Update readme.md

Co-authored-by: Christopher Chong <[email protected]>

---------

Co-authored-by: Christopher Chong <[email protected]>
  • Loading branch information
heeckhau and yuroitaki authored May 6, 2024
1 parent 92d7d68 commit 2d7016e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
18 changes: 13 additions & 5 deletions quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a name="local-notary"></a>

Expand Down
22 changes: 15 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2d7016e

Please sign in to comment.