mirror of
https://github.com/tlsnotary/tlsn-js.git
synced 2026-04-02 03:00:18 -04:00
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 <t.kleinchong@gmail.com> * Update readme.md Co-authored-by: Christopher Chong <t.kleinchong@gmail.com> --------- Co-authored-by: Christopher Chong <t.kleinchong@gmail.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
22
readme.md
22
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
|
||||
|
||||
Reference in New Issue
Block a user