|
56 | 56 | * [`tangerine.reverse(ip[, abortController, purgeCache])`](#tangerinereverseip-abortcontroller-purgecache)
|
57 | 57 | * [`tangerine.setDefaultResultOrder(order)`](#tangerinesetdefaultresultorderorder)
|
58 | 58 | * [`tangerine.setServers(servers)`](#tangerinesetserversservers)
|
59 |
| - * [`tangerine.spoofPacket(hostname, rrtype, answers[, json])`](#tangerinespoofpackethostname-rrtype-answers-json) |
| 59 | + * [`tangerine.spoofPacket(hostname, rrtype, answers[, json, expires = 30000])`](#tangerinespoofpackethostname-rrtype-answers-json-expires--30000) |
60 | 60 | * [Options](#options)
|
61 | 61 | * [Cache](#cache)
|
62 | 62 | * [Compatibility](#compatibility)
|
@@ -332,14 +332,16 @@ This mirrors output from <https://github.com/rthalley/dnspython>.
|
332 | 332 |
|
333 | 333 | ### `tangerine.setServers(servers)`
|
334 | 334 |
|
335 |
| -### `tangerine.spoofPacket(hostname, rrtype, answers[, json])` |
| 335 | +### `tangerine.spoofPacket(hostname, rrtype, answers[, json, expires = 30000])` |
336 | 336 |
|
337 | 337 | This method is useful for writing tests to spoof DNS packets in-memory.
|
338 | 338 |
|
339 | 339 | The `rrtype` must be either `"TXT"` or `"MX"`, and `answers` must be an Array of DNS resource record answers.
|
340 | 340 |
|
341 | 341 | If you pass `json` as `true`, then value returned will be converted to JSON via `JSON.stringify`.
|
342 | 342 |
|
| 343 | +The last argument `expires` can either be a `Date` or `Number`. This is the value used for calculating the DNS packet expiration. If it is a `Number`, then the `expires` value will be `Date.now() + expires`. The default value is `30000`, which means it will expire in 30 seconds. |
| 344 | +
|
343 | 345 | For example, if you want to spoof TXT and MX records:
|
344 | 346 |
|
345 | 347 | ```js
|
|
0 commit comments