move examples to examples directory, update readme and changelog
This commit is contained in:
parent
7904e095e9
commit
868e488530
@ -1,4 +1,5 @@
|
||||
# Version 4.0.0 - yyyy-mm-dd
|
||||
|
||||
- added `streamEncode` and `streamDecode` methods for encoding TCP packets.
|
||||
- Changed the decoded value of TXT records to an array of Buffers. This is to accomodate DNS-SD records which rely on the individual strings record being separated.
|
||||
- Renamed the `flag_trunc` and `flag_auth` to `flag_tc` and `flag_aa` to match the names of these in the dns standards.
|
||||
|
||||
16
README.md
16
README.md
@ -35,19 +35,31 @@ socket.on('message', function (message) {
|
||||
socket.send(buf, 0, buf.length, 53, '8.8.8.8')
|
||||
```
|
||||
|
||||
Also see [the UDP example](examples/udp.js).
|
||||
|
||||
## TCP Usage
|
||||
|
||||
While DNS has traditionally been used over a datagram transport, it is increasingly being carried over TCP for larger responses commonly including DNSSEC responses and TCP/TLS for privacy reasons.
|
||||
|
||||
See [the TCP example](examples/tcp.js).
|
||||
|
||||
## API
|
||||
|
||||
#### `var buf = packets.encode(packet, [buf], [offset])`
|
||||
|
||||
Encodes a DNS packet into a buffer.
|
||||
Encodes a DNS packet into a buffer containing a UDP payload.
|
||||
|
||||
#### `var packet = packets.decode(buf, [offset])`
|
||||
|
||||
Decode a DNS packet from a buffer
|
||||
Decode a DNS packet from a buffer containing a UDP payload.
|
||||
|
||||
#### `var buf = packets.streamEncode(packet, [buf], [offset])`
|
||||
|
||||
Encodes a DNS packet into a buffer containing a TCP payload.
|
||||
|
||||
#### `var packet = packets.streamDecode(buf, [offset])`
|
||||
|
||||
Decode a DNS packet from a buffer containing a TCP payload.
|
||||
|
||||
#### `var len = packets.encodingLength(packet)`
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user