Annotate

teal-src/net/server.d.tl @ 12610:e2fdcd386ebb

net.server: Add teal description file
author Kim Alvefur <zash@zash.se>
date Sun, 24 Jul 2022 21:25:17 +0200
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12610
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 local record server
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 record LuaSocketTCP
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 record LuaSecCTX
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7 record extra_settings
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 record interface
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 enum socket_type
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 "tcp"
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 "tcp6"
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 "tcp4"
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18 record listeners
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19 onconnect : function (interface)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20 ondetach : function (interface)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21 onattach : function (interface, string)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22 onincoming : function (interface, string, string)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 ondrain : function (interface)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24 onreadtimeout : function (interface)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25 onstarttls : function (interface)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26 onstatus : function (interface, string)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 ondisconnect : function (interface, string)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30 get_backend : function () : string
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
31
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
32 type port = string | integer
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
33 enum read_mode
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34 "*a"
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
35 "*l"
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
36 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
37 type read_size = read_mode | integer
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
38 addserver : function (string, port, listeners, read_size, LuaSecCTX) : interface
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
39 addclient : function (string, port, listeners, read_size, LuaSecCTX, socket_type, extra_settings) : interface
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
40 record listen_config
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
41 read_size : read_size
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
42 tls_ctx : LuaSecCTX
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
43 tls_direct : boolean
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
44 sni_hosts : { string : LuaSecCTX }
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
45 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
46 listen : function (string, port, listeners, listen_config) : interface
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
47 enum quitting
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
48 "quitting"
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
49 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
50 loop : function () : quitting
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
51 closeall : function ()
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
52 setquitting : function (boolean | quitting)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
53
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
54 wrapclient : function (LuaSocketTCP, string, port, listeners, read_size, LuaSecCTX, extra_settings) : interface
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
55 wrapserver : function (LuaSocketTCP, string, port, listeners, listen_config) : interface
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
56 watchfd : function (integer | LuaSocketTCP, function (interface), function (interface)) : interface
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
57 link : function ()
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
58
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
59 record config
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
60 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
61 set_config : function (config)
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
62
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
63 end
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
64
e2fdcd386ebb net.server: Add teal description file
Kim Alvefur <zash@zash.se>
parents:
diff changeset
65 return server