Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ request to finish. (optional, default 4000)
* `cache` -- can be false to disable caching, or implement the cache model, or
an instance of Cache but with a different store (optional, default
platform.cache)
* `header` -- an object containing header flags (optional)

There are only two methods

Expand Down
1 change: 1 addition & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ debug = function debug() {
var Request = exports.Request = function(opts) {
if (!(this instanceof Request)) return new Request(opts);

this.header = opts.header;
this.question = opts.question;
this.server = opts.server;

Expand Down
9 changes: 8 additions & 1 deletion lib/pending.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var random_integer = function() {

SocketQueue.prototype._dequeue = function() {
var req = this._pending.pop();
var id, packet, dnssocket;
var id, packet, dnssocket, k;

if (req) {
id = random_integer();
Expand All @@ -118,6 +118,13 @@ SocketQueue.prototype._dequeue = function() {
packet = new Packet(this._socket.remote(req.server));
packet.header.id = id;
packet.header.rd = 1;
if (req.header) {
for (k in req.header) {
if (k in packet.header) {
packet.header[k] = req.header[k];
}
}
}

if (req.try_edns) {
packet.edns_version = 0;
Expand Down