@push.rocks/smartdns 7.6.1 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_rust/rustdns-client_linux_amd64 +0 -0
- package/dist_rust/rustdns-client_linux_arm64 +0 -0
- package/dist_rust/rustdns_linux_amd64 +0 -0
- package/dist_rust/rustdns_linux_arm64 +0 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts_client/classes.dnsclient.d.ts +14 -32
- package/dist_ts_client/classes.dnsclient.js +63 -55
- package/dist_ts_client/classes.rustdnsclientbridge.d.ts +59 -0
- package/dist_ts_client/classes.rustdnsclientbridge.js +110 -0
- package/dist_ts_client/index.d.ts +1 -0
- package/dist_ts_client/index.js +2 -1
- package/dist_ts_client/plugins.d.ts +8 -1
- package/dist_ts_client/plugins.js +8 -2
- package/dist_ts_server/classes.dnsserver.d.ts +41 -54
- package/dist_ts_server/classes.dnsserver.js +290 -690
- package/dist_ts_server/classes.rustdnsbridge.d.ts +119 -0
- package/dist_ts_server/classes.rustdnsbridge.js +136 -0
- package/dist_ts_server/index.d.ts +1 -0
- package/dist_ts_server/index.js +2 -1
- package/dist_ts_server/plugins.d.ts +8 -7
- package/dist_ts_server/plugins.js +7 -8
- package/npmextra.json +18 -6
- package/package.json +10 -9
- package/readme.hints.md +28 -1
- package/readme.md +345 -645
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/readme.md +47 -0
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartdns',
|
|
6
|
-
version: '7.
|
|
6
|
+
version: '7.8.0',
|
|
7
7
|
description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.'
|
|
8
8
|
}
|
package/ts/readme.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @push.rocks/smartdns
|
|
2
|
+
|
|
3
|
+
Unified entry point that re-exports both the DNS client and DNS server modules.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { dnsClientMod, dnsServerMod } from '@push.rocks/smartdns';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Modules
|
|
12
|
+
|
|
13
|
+
| Module | Description |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `dnsClientMod` | DNS resolution — system, UDP, DoH strategies via `Smartdns` class |
|
|
16
|
+
| `dnsServerMod` | Authoritative DNS server — UDP, HTTPS, DNSSEC, ACME via `DnsServer` class |
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { dnsClientMod, dnsServerMod } from '@push.rocks/smartdns';
|
|
22
|
+
|
|
23
|
+
// Client
|
|
24
|
+
const client = new dnsClientMod.Smartdns({ strategy: 'prefer-udp' });
|
|
25
|
+
const records = await client.getRecordsA('example.com');
|
|
26
|
+
client.destroy();
|
|
27
|
+
|
|
28
|
+
// Server
|
|
29
|
+
const server = new dnsServerMod.DnsServer({
|
|
30
|
+
udpPort: 5333,
|
|
31
|
+
httpsPort: 8443,
|
|
32
|
+
httpsKey: '...',
|
|
33
|
+
httpsCert: '...',
|
|
34
|
+
dnssecZone: 'example.com',
|
|
35
|
+
});
|
|
36
|
+
server.registerHandler('example.com', ['A'], (q) => ({
|
|
37
|
+
name: q.name, type: 'A', class: 'IN', ttl: 300, data: '93.184.215.14',
|
|
38
|
+
}));
|
|
39
|
+
await server.start();
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
For direct imports, use the sub-module paths:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { Smartdns } from '@push.rocks/smartdns/client';
|
|
46
|
+
import { DnsServer } from '@push.rocks/smartdns/server';
|
|
47
|
+
```
|