8000 GitHub - anudit/tlsn-js
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

anudit/tlsn-js

 
 

Repository files navigation

tlsn-js

NPM Modules for proving and verifying using TLS Notary in the browser.

The prover requires a notary-server and websockify proxy

Example

import { prove, verify, NOTARY_SERVER_PUBKEY } from '../src';

// To create a proof
const proof = await prove('https://swapi.dev/api/people/1', {
    method: 'GET',
    headers: {
      Connection: 'close',
      Accept: 'application/json',
      'Accept-Encoding': 'identity',
    },
    body: '',
    maxTranscriptSize: 20000,
    notaryUrl: 'https://127.0.0.1:7047',
    websocketProxyUrl: 'ws://127.0.0.1:55688',
});

// To verify a proof
const result = await verify(proof, NOTARY_SERVER_PUBKEY);
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

Install as NPM Package

npm install tlsn-js

Development

# make sure you have rust install
# https://www.rust-lang.org/tools/install
npm install

# this serve a page that will execute the example code at http://localhost:3001 
npm run dev

Build for NPM

npm install
npm run build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 63.5%
  • TypeScript 20.9%
  • JavaScript 11.6%
  • Shell 2.8%
  • EJS 1.2%
0