https://github.com/tradle/sendy-otr
https://github.com/tradle/sendy-otr
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tradle/sendy-otr
- Owner: tradle
- Created: 2016-03-07T14:44:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-02T01:16:18.000Z (almost 10 years ago)
- Last Synced: 2024-04-14T13:16:01.436Z (about 2 years ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sendy-otr
An OTR layer for [sendy](https://github.com/tradle/sendy)
# Example
```js
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)
})
```