MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / send

Method send

modules/network/dns/dnsresolverdoh.js:63–82  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

61 }
62 }
63 send(request) {
64 const body = new Serializer({query: true, recursionDesired: true, opcode: DNS.OPCODE.QUERY, id: request.id});
65 body.add(DNS.SECTION.QUESTION, request.host, DNS.RR.A, DNS.CLASS.IN);
66
67 this.request = new Request({
68 host: "8.8.8.8",
69 path: "/dns-query",
70 port: 443,
71 headers: ["host", "dns.google", "content-type", "application/dns-message"],
72 method: "POST",
73 body: body.build(),
74 response: ArrayBuffer,
75 Socket: SecureSocket,
76 secure: {
77 protocolVersion: 0x303,
78 trace: false,
79 }
80 });
81 this.request.callback = this.callback.bind(this);
82 }
83 callback(message, value, address, port) {
84 let done = Request.error === message;
85

Callers 2

addMethod · 0.95
callbackMethod · 0.95

Calls 3

addMethod · 0.95
buildMethod · 0.95
bindMethod · 0.45

Tested by

no test coverage detected