New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dns-suite

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dns-suite - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

test/fixtures/_services._dns-sd._udp.local.ptr.0.bin

6

dns.js

@@ -11,3 +11,7 @@ ;(function (exports) {

// backwards compat with node buffer
var ab = nb.buffer || nb;
var ab = nb;
if (nb.buffer) {
// TODO pass byteOffsets to unpacker
ab = nb.buffer.slice(nb.byteOffset, nb.byteOffset + nb.byteLength);
}
var packet = Parser.unpack(ab);

@@ -14,0 +18,0 @@

2

package.json
{
"name": "dns-suite",
"version": "1.0.2",
"version": "1.0.3",
"description": "testing dns",

@@ -5,0 +5,0 @@ "main": "dns.js",

@@ -80,2 +80,5 @@ dns-suite

* CLI
* API
**CLI**

@@ -89,15 +92,2 @@

Capture mDNS broadcast packets
```bash
# example
# node bin/mdns-capture.js <file-prefix>
node bin/mdns-capture.js mdns-test
```
```bash
# in another terminal
dig @224.0.0.251 -p 5353 -t PTR _services._dns-sd._udp.local
```
Parsing a saved packet

@@ -117,5 +107,5 @@

* `packet = dnsjs.unpack(arrayBuffer)`
* `packet = dnsjs.unpackRdatas(arrayBuffer, packet)`
* `packet.answers[0].data = dnsjs.unpackRdatas(arrayBuffer, packet, packet.answers[0])`
* `DNSPacket.parse(nodeOrArrayBuffer)` returns json (as shown above)
* `DNSPacket.pack(packet)` returns ArrayBuffer (browser and node)
* `DNSPacket.write(packet)` returns NodeBuffer (node only)

@@ -127,6 +117,8 @@ node.js:

var dnsjs = require('dns-suite');
var packet = dnsjs.unpack(arrayBuffer);
var DNSPacket = require('dns-suite').DNSPacket;
var packet = DNSPacket.parse(arrayBuffer);
var ab = DNSPacket.pack(packet);
console.log(packet);
console.log(new Uint8Array(ab));
```

@@ -138,7 +130,26 @@

var packet = pdns.unpack(arrayBuffer);
var packet = DNSPacket.parse(arrayBuffer);
var ab = DNSPacket.pack(packet);
console.log(packet);
console.log(new Uint8Array(ab));
```
Capturing Packets
-----
We have a command line tool for that! See [dig.js](https://git.daplie.com/Daplie/dig.js).
```
# Install
npm install -g 'git+https://git@git.daplie.com/Daplie/dig.js.git'
# Use with DNS
dig.js A daplie.com --output .
# Use with mDNS
dig.js --mdns PTR _services._dns-sd._udp.local --output .
```
Contributing and Development

@@ -145,0 +156,0 @@ ============================

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