https://github.com/rs/node-dnsstamp
DNS Stamp encoding/decoding library for node
https://github.com/rs/node-dnsstamp
Last synced: about 1 year ago
JSON representation
DNS Stamp encoding/decoding library for node
- Host: GitHub
- URL: https://github.com/rs/node-dnsstamp
- Owner: rs
- License: mit
- Created: 2019-05-13T23:54:05.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-22T17:15:47.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T21:12:14.826Z (about 1 year ago)
- Language: TypeScript
- Size: 51.8 KB
- Stars: 15
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DNS Stamp
This node module provides a simple API to parse and generate [DNS Stamp](https://dnscrypt.info/stamps-specifications/) as defined by [Frank Denis](https://twitter.com/jedisct1).
## Installation
npm install dnsstamp
## Usage
Parse a stamp URL:
```js
const DNSStamp = require('dnsstamp');
let stamp = DNSStamp.parse(sdns);
```
Create a stamp URL:
```js
const DNSStamp = require('dnsstamp');
let stamp = new DNSStamp.DNSCrypt(addr, {
pk: pk,
providerName: providerName,
});
let sdns = stamp.toString();
```
Supported stamps:
* `DNSStamp.DNSCrypt`: constructor(`addr`, {`props`, `pk`, `providerName`})
* `DNSStamp.DOH`: constructor(`addr`, {`props`, `hostName`, `hash`, `path`})
* `DNSStamp.DOT`: constructor(`addr`, {`props`, `hostName`, `hash`})
* `DNSStamp.Plain`: constructor(`addr`, {`props`})
## Licenses
All source code is licensed under the [MIT License](https://raw.github.com/rs/node-dnsstamp/master/LICENSE).