]> git.lizzy.rs Git - hydra-dragonfire.git/blob - example/dump-traffic.lua
b3d89da1869febf2522f1b384c49d004d4aeca68
[hydra-dragonfire.git] / example / dump-traffic.lua
1 #!/usr/bin/env hydra-dragonfire
2 local client = require("client")()
3
4 client:wildcard(true)
5 client:connect()
6
7 while not hydra.canceled() do
8         local pkt, interrupt = client:poll()
9
10         if pkt then
11                 print(pkt._type)
12                 for k, v in pairs(pkt) do
13                         if k ~= "_type" then
14                                 print("", k, v)
15                         end
16                 end
17         elseif not interrupt then
18                 print("disconnected")
19                 break
20         end
21 end
22
23 client:close()