How to use the dns-packet.streamDecode function in dns-packet

To help you get started, we’ve selected a few dns-packet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sagi / node-dns-over-tls / src / dnstls.ts View on Github external
export const checkDone = ({
  response,
  packetLength,
  socket,
  resolve,
}: ICheckDoneParams) => {
  // Why + TWO_BYTES? See comment in query()
  if (response.length === packetLength + TWO_BYTES) {
    socket.destroy();
    resolve(dnsPacket.streamDecode(response));
  }
};