https://github.com/nodertc/is-turn
Check if a Buffer is a TURN message.
https://github.com/nodertc/is-turn
js node nodertc stun turn webrtc
Last synced: about 1 month ago
JSON representation
Check if a Buffer is a TURN message.
- Host: GitHub
- URL: https://github.com/nodertc/is-turn
- Owner: nodertc
- License: mit
- Created: 2017-07-12T09:35:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-13T20:20:53.000Z (over 8 years ago)
- Last Synced: 2025-09-23T03:45:24.468Z (9 months ago)
- Topics: js, node, nodertc, stun, turn, webrtc
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# is-turn
[](https://travis-ci.org/nodertc/is-turn)
[](https://npmjs.org/package/is-turn)
[](https://npmjs.org/package/is-turn)
[](https://npmjs.org/package/is-turn)
[](https://npmjs.org/package/is-turn)
Check if a Buffer is a [TURN](https://tools.ietf.org/html/rfc5766) 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_turn = require('is-turn')
const socket = dgram.createSocket('udp4')
socket.on('message', (packet) => {
if (is_turn(packet)) {
// handle TURN...
}
})
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-stun`](https://github.com/nodertc/is-stun) - Check if a Buffer is a [STUN](https://tools.ietf.org/html/rfc5389) 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