nodertc / is-dtls

Check if a Buffer is a DTLS message.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is-dtls

Build Status npm node license downloads

Check if a Buffer is a DTLS message. Used for demultiplex packets that are arriving on the same port. Follows RFC7983.

Usage

const dgram = require('dgram')
const is_dtls = require('is-dtls')

const socket = dgram.createSocket('udp4')

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

socket.bind(0)

Related projects

License

MIT, 2017 (c) Dmitry Tsvettsikh

About

Check if a Buffer is a DTLS message.

License:MIT License


Languages

Language:JavaScript 100.0%