forked from luvit/luv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lots-o-dns.lua
49 lines (44 loc) · 829 Bytes
/
lots-o-dns.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
local p = require('lib/utils').prettyPrint
local uv = require('luv')
uv.getaddrinfo(nil, 80, nil, p)
local domains = {
"facebook.com",
"google.com",
"mail.google.com",
"maps.google.com",
"plus.google.com",
"play.google.com",
"apple.com",
"hp.com",
"yahoo.com",
"mozilla.com",
"developer.mozilla.com",
"luvit.io",
"creationix.com",
"howtonode.org",
"github.com",
"gist.github.com"
}
local i = 1
local function next()
uv.getaddrinfo(domains[i], nil, {
v4mapped = true,
all = true,
addrconfig = true,
canonname = true,
numericserv = true,
socktype = "STREAM"
}, function (err, data)
assert(not err, err)
p(data)
i = i + 1
if i <= #domains then
next()
end
end)
end
next();
repeat
print("\nTick..")
until uv.run('once') == 0
print("done")