-
Notifications
You must be signed in to change notification settings - Fork 0
/
neosocksd.lua
82 lines (48 loc) · 1.46 KB
/
neosocksd.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
-- neosocksd (c) 2023-2024 He Xian <hexian000@outlook.com>
-- This code is licensed under MIT license (see LICENSE for details)
-- [[ neosocksd.lua: dummy lib for linter ]] --
error("dummy lib should not be loaded")
local function marshal(...)
return ""
end
_G.marshal = marshal
local await = {}
function await.resolve(s) return "" end
function await.invoke(code, addr, ...) return false, ... end
function await.sleep(n) end
function await.idle() end
_G.await = await
local neosocksd = {}
function neosocksd.config() return {} end
function neosocksd.invoke(code, addr, ...) end
function neosocksd.now() return 0 end
function neosocksd.parse_ipv4(s) return 0 end
function neosocksd.parse_ipv6(s) return 0, 0 end
function neosocksd.resolve(s) return "" end
function neosocksd.setinterval(n) end
function neosocksd.splithostport(s) return "", "" end
function neosocksd.stats() return {} end
function neosocksd.traceback(s) return debug.traceback(s) end
_G.neosocksd = neosocksd
local regex = {}
function regex:find(s, init)
return 0, 0
end
function regex:match(s, init)
return s
end
function regex:gmatch(s, init)
return function()
init = init + 1
return self:match(s, init)
end
end
local regex_mt = { __index = regex }
function regex.compile(pattern)
return setmetatable({}, regex_mt)
end
_G.regex = regex
local zlib = {}
function zlib.compress(s) return "" end
function zlib.uncompress(z) return "" end
_G.zlib = zlib