1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

mooni2p = require("mooni2p") local session_name = "testclient" local target = arg[1] if target == nil then print(string.format("missing target. usage: lua5.3 %s target.i2p", arg[0])) else -- create client SAM session local session_sock = assert(mooni2p.create_session(session_name)) -- connect to remote I2P destination local sock = assert(mooni2p.stream_connect(session_name, target)) sock:send("PING

") local data = sock:receive("*l") print(data) sock:send("STOP

") sock:close() -- shutdown SAM session session_sock:close() end