0.4.18 • Published 12 months ago

@hazae41/echalote v0.4.18

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago
npm i @hazae41/echalote

Node Package 📦Online Demo 🌐Next.js CodeSandbox 🪣

Use at your own risk

This is experimental software in early development

  1. It has security issues
  2. Things change quickly

Features

Current features

  • 100% TypeScript and ESM
  • Zero-copy reading and writing
  • Works in the browser
  • All cryptography use either WebCrypto or reproducible WebAssembly ports of Rust implementations
  • Unsafe Tor protocol (with Ed25519, ntor, kdf-tor)
  • Meek (HTTP) transport (without domain-fronting)
  • Snowflake (WebRTC/WebSocket) transport (without domain-fronting)
  • Unsafe TLS using Cadenas
  • HTTP and WebSocket messaging using Fleche

Upcoming features

  • Better security

Usage

import { createWebSocketSnowflakeStream, TorClientDuplex, Consensus } from "@hazae41/echalote"
import { Ciphers, TlsClientDuplex } from "@hazae41/cadenas"

const tcp = await createWebSocketSnowflakeStream("wss://snowflake.bamsoftware.com/")
const tor = new TorClientDuplex()

tcp.outer.readable.pipeTo(tor.inner.writable).catch(() => {})
tor.inner.readable.pipeTo(tcp.outer.writable).catch(() => {})

await tor.waitOrThrow()

using circuit = await tor.createOrThrow()
const consensus = await Consensus.fetchOrThrow(circuit)

const middles = consensus.microdescs.filter(it => true
  && it.flags.includes("Fast")
  && it.flags.includes("Stable")
  && it.flags.includes("V2Dir"))

const exits = consensus.microdescs.filter(it => true
  && it.flags.includes("Fast")
  && it.flags.includes("Stable")
  && it.flags.includes("Exit")
  && !it.flags.includes("BadExit"))

const middle = middles[Math.floor(Math.random() * middles.length)]
const middle2 = await Consensus.Microdesc.fetchOrThrow(circuit, middle)
await circuit.extendOrThrow(middle2, AbortSignal.timeout(5000))

const exit = exits[Math.floor(Math.random() * middles.length)]
const exit2 = await Consensus.Microdesc.fetchOrThrow(circuit, exit)
await circuit.extendOrThrow(exit2, AbortSignal.timeout(5000))

const ttcp = await circuit.openOrThrow("twitter.com", 443)

const ciphers = [Ciphers.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384]
const ttls = new TlsClientDuplex({ host_name: url.hostname, ciphers })

ttcp.outer.readable.pipeTo(ttls.inner.writable).catch(() => { })
ttls.inner.readable.pipeTo(ttcp.outer.writable).catch(() => { })

const response = await fetch("https://twitter.com", { stream: ttls.outer })
const text = await response.text()
0.4.9

12 months ago

0.4.8

1 year ago

0.4.10

12 months ago

0.4.18

12 months ago

0.4.16

12 months ago

0.4.13

12 months ago

0.4.14

12 months ago

0.4.11

12 months ago

0.4.5

1 year ago

0.4.7

1 year ago

0.4.6

1 year ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.9

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.8-0

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.2

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2-1

2 years ago

0.3.2-0

2 years ago

0.3.0

2 years ago

0.3.1

2 years ago

0.2.84

2 years ago

0.2.83

2 years ago

0.2.82

2 years ago

0.2.81

2 years ago

0.2.80

2 years ago

0.2.74

2 years ago

0.2.73

2 years ago

0.2.72

2 years ago

0.2.71

2 years ago

0.2.70

2 years ago

0.2.66-0

2 years ago

0.2.79

2 years ago

0.2.78

2 years ago

0.2.77

2 years ago

0.2.76

2 years ago

0.2.75

2 years ago

0.2.63

2 years ago

0.2.62

2 years ago

0.2.61

2 years ago

0.2.60

2 years ago

0.2.69

2 years ago

0.2.68

2 years ago

0.2.67

2 years ago

0.2.65

2 years ago

0.2.64

2 years ago

0.2.67-3

2 years ago

0.2.67-2

2 years ago

0.2.67-5

2 years ago

0.2.67-4

2 years ago

0.2.59

2 years ago

0.2.67-1

2 years ago

0.2.58

2 years ago

0.2.57

2 years ago

0.2.56

2 years ago

0.2.55

2 years ago

0.2.54

2 years ago

0.2.53-2

2 years ago

0.2.53-1

2 years ago

0.2.53-0

2 years ago

0.2.52

2 years ago

0.2.51

2 years ago

0.2.50

2 years ago

0.2.53

2 years ago

0.2.41

2 years ago

0.2.40

2 years ago

0.2.49

2 years ago

0.2.48

2 years ago

0.2.47

2 years ago

0.2.46

2 years ago

0.2.45

2 years ago

0.2.44

2 years ago

0.2.43

2 years ago

0.2.42

2 years ago

0.2.39

2 years ago

0.2.38

2 years ago

0.2.37

2 years ago

0.2.27

2 years ago

0.2.25

2 years ago

0.2.24

2 years ago

0.2.24-1

2 years ago

0.2.30

2 years ago

0.2.24-0

2 years ago

0.2.36

2 years ago

0.2.35

2 years ago

0.2.33

2 years ago

0.2.31

2 years ago

0.2.29

2 years ago

0.2.28

2 years ago

0.2.23

2 years ago

0.2.22

3 years ago

0.2.21

3 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.23-2

2 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.23-0

2 years ago

0.2.16

3 years ago

0.2.23-1

2 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago