# is-stun

> Check if a Buffer is a STUN message.

Latest version **2.0.0** (published 2018-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-stun
pnpm add is-stun
yarn add is-stun
bun add is-stun
```

## 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 | 2.0.0 |
| Published | 2018-01-13 |
| First published | 2017-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dmitry Tsvettsikh |
| Maintainers | reklatsmasters |
| Keywords | stun, rfc7983, rfc5764, rfc5389, packet, message, test, detect, demultiplexing, demultiplex, demux |

## Links

- npm: https://www.npmjs.com/package/is-stun
- Repository: https://github.com/nodertc/is-stun
- Homepage: https://github.com/nodertc/is-stun#readme
- Issues: https://github.com/nodertc/is-stun/issues
- npm.io page: https://npm.io/package/is-stun

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-01-13
- 1.0.0 — 2017-07-12

## README

# is-stun

[![Build Status](https://travis-ci.org/nodertc/is-stun.svg?branch=master)](https://travis-ci.org/nodertc/is-stun)
[![npm](https://img.shields.io/npm/v/is-stun.svg)](https://npmjs.org/package/is-stun)
[![node](https://img.shields.io/node/v/is-stun.svg)](https://npmjs.org/package/is-stun)
[![license](https://img.shields.io/npm/l/is-stun.svg)](https://npmjs.org/package/is-stun)
[![downloads](https://img.shields.io/npm/dm/is-stun.svg)](https://npmjs.org/package/is-stun)

Check if a Buffer is a [STUN](https://tools.ietf.org/html/rfc5389) message. Used for demultiplex packets that are arriving on the same port. Follows [RFC7983](https://tools.ietf.org/html/rfc7983#section-7).

## Usage

```js
const dgram = require('dgram')
const is_stun = require('is-stun')

const socket = dgram.createSocket('udp4')

socket.on('message', (packet) => {
  if (is_stun(packet)) {
    // handle STUN...
  }
})

socket.bind(0)
```

## Related projects

* [`is-dtls`](https://github.com/nodertc/is-dtls) - Check if a Buffer is a [DTLS](https://tools.ietf.org/html/rfc4347) message.
* [`is-turn`](https://github.com/nodertc/is-turn) - Check if a Buffer is a [TURN](https://tools.ietf.org/html/rfc5766) message.
* [`is-rtp`](https://github.com/nodertc/is-rtp) - Check if a Buffer is a [RTP/RTCP](https://tools.ietf.org/html/rfc3550) message.

## License

MIT, 2017 (c) Dmitry Tsvettsikh

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