Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dat-dns

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dat-dns

Issue DNS lookups for Dat archives using HTTPS requests to the target host.

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132
increased by8.2%
Maintainers
1
Weekly downloads
 
Created
Source

dat-dns

Issue DNS lookups for Dat archives using HTTPS requests to the target host. Keeps an in-memory cache of recent lookups.

API

var datDns = require('dat-dns')()

// resolve a name: pass the hostname by itself
datDns.resolveName('foo.com', function (err, key) { ... })
datDns.resolveName('foo.com').then(key => ...)

// dont use cached 'misses'
datDns.resolveName('foo.com', {ignoreCachedMiss: true})

// clear the cache
datDns.flushCache()

Spec

In detail.

Place a file at /.well-known/dat with the following schema:

{dat-url}
TTL={time in seconds}

TTL is optional and will default to 3600 (one hour). If set to 0, the entry is not cached.

Dat-name Resolution

Resolution of a site at dat://hostname will occur with the following process:

  • Browser checks its dat names cache. If a non-expired entry is found, return with the entry.
  • Browser issues a GET request to https://hostname/.well-known/dat.
  • If the server responds with a 404 Not Found status, store a null entry in the cache with a TTL of 3600 and return a failed lookup.
  • If the server responds with anything other than a 200 OK status, return a failed lookup.
  • If the server responds with a malformed file, return a failed lookup.
  • If the response includes no TTL, set to default 3600.
  • If the response includes a non-zero TTL, store the entry in the dat-name cache.
  • Return the entry.

Keywords

FAQs

Package last updated on 13 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc