1 #!/usr/bin/env lua |
1 #!/usr/bin/env lua |
2 |
2 |
3 local socket = require "socket"; |
3 function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else |
|
4 return nil, lib; end end |
|
5 |
|
6 -- Required to be able to find packages installed with luarocks |
|
7 if not softreq "luarocks.loader" then -- LuaRocks 2.x |
|
8 softreq "luarocks.require"; -- LuaRocks <1.x |
|
9 end |
|
10 |
|
11 local socket = softreq "socket"; |
4 |
12 |
5 -- Defaults -- |
13 -- Defaults -- |
6 default_port = 5222; |
14 default_port = 5222; |
7 default_namespace = "jabber:client"; |
15 default_namespace = "jabber:client"; |
8 default_timeout = 1.5; |
16 default_timeout = 1.5; |