sendy-otr

2.1.0 • Public • Published

sendy-otr

An OTR layer for sendy

Example

var OTRClient = require('sendy-otr') // OTR layer
var MessageClient = require('sendy') // enables message reassembly from UTP packets
var Connection = Sendy.Connection    // symmetric UTP protocol
var networkClient = ...              // must implement `send` method and 'receive' event

var client = new OTRClient({
  key: new DSA(),
  theirFingerprint: 'their otr fingerprint',
  client: new MessageClient({
    client: new Connection({
      mtu: 1500
    })
  })
})

client.on('send', function (msg) {
  // use unreliable network client
  // and guarantee delivery
  networkClient.send(msg)
})

networkClient.on('receive', function (msg) {
  // get a message from the network
  // process it through pipeline
  client.receive(msg)
})

/sendy-otr/

    Package Sidebar

    Install

    npm i sendy-otr

    Weekly Downloads

    0

    Version

    2.1.0

    License

    MIT

    Last publish

    Collaborators

    • spwilko
    • leichtgewicht
    • tenaciousmv
    • pgmemk
    • genevayngrib