0.0.3 • Published 10 months ago

mock-dns-server v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

mock-dns-server

Create a mock DNS-over-TLS server based on mock-tls-server.

Installation

npm install -D mock-dns-server

API

Full API documentation is available.

Example:

import {connect, createServer} from 'mock-dns-server';

/** @type {import('mock-dns-server').Zones} */
const zones = {
  'xmpp.example.com': {
    A: ['192.168.1.2', '192.168.1.3'],
  },
  '_xmpp-server._tcp.example.com': {
    SRV: {
      priority: 30,
      weight: 30,
      port: 5269,
      target: 'xmpp.example.com',
    },
  },
};
const server = createServer({zones});

/** @type {import('node:tls').TLSSocket} */
const sock = connect(server.port);

Build Status codecov

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago