diff options
| author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-05-28 23:16:55 +0200 |
|---|---|---|
| committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-05-28 23:16:55 +0200 |
| commit | f0318bd020abe57c0cf365b0479b5d14b95ff07a (patch) | |
| tree | ed2d89cda1adeb6f3ed6a6da98e054e2b7519c37 /example | |
| parent | fea98ddbbe886845ed41ab87d9a2d24323c8de82 (diff) | |
| download | hydra-dragonfire-f0318bd020abe57c0cf365b0479b5d14b95ff07a.tar.xz | |
Migrate to gopher-lua
Diffstat (limited to 'example')
| -rwxr-xr-x | example/dump-traffic.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/example/dump-traffic.lua b/example/dump-traffic.lua new file mode 100755 index 0000000..b9f30a3 --- /dev/null +++ b/example/dump-traffic.lua @@ -0,0 +1,28 @@ +#!/usr/bin/env hydra +local address, name, password = unpack(arg) +local client = hydra.client(address) + +client:enable("auth") +client.auth:username(name) +client.auth:password(password or "") + +client:wildcard(true) +client:connect() + +while not hydra.canceled() do + local pkt, interrupt = client:poll() + + if pkt then + print(pkt._type) + for k, v in pairs(pkt) do + if k ~= "_type" then + print("", k, v) + end + end + elseif not interrupt then + print("disconnected") + break + end +end + +client:disconnect() |
