# zwaveip-securedgram

> A partial DTLS 1.0 implementation for Node.js

Latest version **1.0.0** (published 2017-03-03) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install zwaveip-securedgram
pnpm add zwaveip-securedgram
yarn add zwaveip-securedgram
bun add zwaveip-securedgram
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-03-03 |
| First published | 2017-03-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zwaveiot |
| Maintainers | zwaveiot |
| Keywords | zwaveip, dtls |

## Links

- npm: https://www.npmjs.com/package/zwaveip-securedgram
- Repository: https://github.com/zwaveiot/dtls-node
- Homepage: https://github.com/zwaveiot/dtls-node#readme
- Issues: https://github.com/zwaveiot/dtls-node/issues
- npm.io page: https://npm.io/package/zwaveip-securedgram

## Recent versions

- 1.0.0 (latest) — 2017-03-03

## README

# dtls-node
A partial DTLS 1.0 implementation for Node.js. Unofficial library, not supported by Sigma Designs.

This 'securedgram' library is designed to be a mostly-drop-in replacement for the standard node.js 'dgram' library.

This library supports DTLS 1.0 and the following ciphersuites:
* TLS_PSK_WITH_AES_128_CBC_SHA
* TLS_PSK_WITH_AES_256_CBC_SHA

#### To install the library
> npm install zwaveip-securedgram

#### To import the library
> let DtlsSocket = require('zwaveip-securedgram');

#### To create a socket instance
> let dtlsSocket = DtlsSocket.createDtlsSocket(ipAddressFamily, callbackObject, callback);
* ipAddressFamily options: ['udp4', 'udp6']  
* callbackObject: OPTIONAL object passed in first parameter of callback to tag this socket  
* callback: OPTIONAL callback, called when a message is received  

#### To send a message
> dtlsSocket.send(message, offset, length, port, host, pskIdentity, pskPassword, callback);
* message: buffer containing message to send  
* offset: offset (within buffer)  
* length: length (within buffer)  
* port: port #  
* host: hostname or ip address  
* pskIdentity: PSK "identity" parameter  
* pskPassword: Pre-shared key ("PSK password")  
* callback: OPTIONAL callback  

#### To receive a message (via createDtlsSocket-specified callback)
> let onMessage = function(callbackObject, data, rinfo) {
>   // handle message here
> }
###### NOTE: the developer must pass this function as the callback parameter when instantiating the DtlsSocket.

---
_Source: https://npm.io/package/zwaveip-securedgram · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
