mock-dns-server
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i mock-dns-server

Weekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

9.81 kB

Total Files

5

Last publish

Collaborators

  • hildjj