@@ -11,6 +11,7 @@ Table of Contents
11
11
* [ Synopsis] ( #synopsis )
12
12
* [ Description] ( #description )
13
13
* [ Prerequisites] ( #prerequisites )
14
+ * [ Installation] ( #installation )
14
15
* [ API Implemented] ( #api-implemented )
15
16
* [ resty.core.hash] ( #restycorehash )
16
17
* [ resty.core.base64] ( #restycorebase64 )
@@ -20,16 +21,20 @@ Table of Contents
20
21
* [ resty.core.shdict] ( #restycoreshdict )
21
22
* [ resty.core.var] ( #restycorevar )
22
23
* [ resty.core.ctx] ( #restycorectx )
24
+ * [ get_ctx_table] ( #get_ctx_table )
23
25
* [ resty.core.request] ( #restycorerequest )
24
26
* [ resty.core.response] ( #restycoreresponse )
25
27
* [ resty.core.misc] ( #restycoremisc )
26
28
* [ resty.core.time] ( #restycoretime )
27
29
* [ resty.core.worker] ( #restycoreworker )
28
30
* [ resty.core.phase] ( #restycorephase )
29
31
* [ resty.core.ndk] ( #restycorendk )
32
+ * [ resty.core.socket] ( #restycoresocket )
33
+ * [ resty.core.param] ( #restycoreparam )
30
34
* [ ngx.semaphore] ( #ngxsemaphore )
31
35
* [ ngx.balancer] ( #ngxbalancer )
32
36
* [ ngx.ssl] ( #ngxssl )
37
+ * [ ngx.ssl.clienthello] ( #ngxsslclienthello )
33
38
* [ ngx.ssl.session] ( #ngxsslsession )
34
39
* [ ngx.re] ( #ngxre )
35
40
* [ ngx.resp] ( #ngxresp )
@@ -51,7 +56,7 @@ This library is production ready.
51
56
Synopsis
52
57
========
53
58
54
- This library is automatically loaded by default in OpenResty 1.15.8.1. This
59
+ This library is automatically loaded by default since OpenResty 1.15.8.1. This
55
60
behavior can be disabled via the
56
61
[ lua_load_resty_core] ( https://github.com/openresty/lua-nginx-module#lua_load_resty_core )
57
62
directive, but note that the use of this library is vividly recommended, as its
@@ -108,12 +113,45 @@ of this library in the particular OpenResty release you are using. Otherwise you
108
113
into serious compatibility issues.
109
114
110
115
* LuaJIT 2.1 (for now, it is the v2.1 git branch in the official luajit-2.0 git repository: http://luajit.org/download.html )
111
- * [ ngx_http_lua_module] ( https://github.com/openresty/lua-nginx-module ) v0.10.18 .
112
- * [ ngx_stream_lua_module] ( https://github.com/openresty/stream-lua-nginx-module ) v0.0.9 .
116
+ * [ ngx_http_lua_module] ( https://github.com/openresty/lua-nginx-module ) v0.10.25 .
117
+ * [ ngx_stream_lua_module] ( https://github.com/openresty/stream-lua-nginx-module ) v0.0.13 .
113
118
* [ lua-resty-lrucache] ( https://github.com/openresty/lua-resty-lrucache )
114
119
115
120
[ Back to TOC] ( #table-of-contents )
116
121
122
+ Installation
123
+ ============
124
+
125
+ By default, LuaJIT will search Lua files in /usr/local/share/lua/5.1/.
126
+ But ` make install ` will install this module to /usr/local/lib/lua.
127
+ So you may find the error like this:
128
+
129
+ ``` text
130
+ nginx: [alert] failed to load the 'resty.core' module
131
+ ```
132
+
133
+ You can install this module with the following command to resolve the above problem.
134
+
135
+ ``` bash
136
+ cd lua-resty-core
137
+ sudo make install LUA_LIB_DIR=/usr/local/share/lua/5.1
138
+ ```
139
+
140
+ You can also change the installation directory to any other directory you like with the LUA_LIB_DIR argument.
141
+
142
+ ``` bash
143
+ cd lua-resty-core
144
+ sudo make install LUA_LIB_DIR=/opt/nginx/lualib
145
+ ```
146
+
147
+ After that, you need to add the above directory to the LuaJIT search direcotries with ` lua_package_path ` nginx directive in the http context and stream context.
148
+
149
+ ```
150
+ lua_package_path "/opt/nginx/lualib/?.lua;;";
151
+ ```
152
+
153
+ [ Back to TOC] ( #table-of-contents )
154
+
117
155
API Implemented
118
156
===============
119
157
@@ -188,6 +226,21 @@ API Implemented
188
226
189
227
[ Back to TOC] ( #table-of-contents )
190
228
229
+ ## get_ctx_table
230
+
231
+ ** syntax:** * ctx = resty.core.ctx.get_ctx_table(ctx?)*
232
+
233
+ Similar to [ ngx.ctx] ( #restycorectx ) but it accepts an optional ` ctx ` argument.
234
+ It will use the ` ctx ` from caller instead of creating a new table
235
+ when the ` ctx ` table does not exist.
236
+
237
+ Notice: the ` ctx ` table will be used in the current request's whole life cycle.
238
+ Please be very careful when you try to reuse the ` ctx ` table.
239
+ You need to make sure there is no Lua code using or going to use the ` ctx ` table
240
+ in the current request before you reusing the ` ctx ` table in some other place.
241
+
242
+ [ Back to TOC] ( #table-of-contents )
243
+
191
244
## resty.core.request
192
245
193
246
* [ ngx.req.get_headers] ( https://github.com/openresty/lua-nginx-module#ngxreqget_headers )
@@ -211,6 +264,7 @@ API Implemented
211
264
* [ ngx.status] ( https://github.com/openresty/lua-nginx-module#ngxstatus )
212
265
* [ ngx.is_subrequest] ( https://github.com/openresty/lua-nginx-module#ngxis_subrequest )
213
266
* [ ngx.headers_sent] ( https://github.com/openresty/lua-nginx-module#ngxheaders_sent )
267
+ * [ ngx.req.is_internal] ( https://github.com/openresty/lua-nginx-module#ngxreqis_internal )
214
268
215
269
[ Back to TOC] ( #table-of-contents )
216
270
@@ -224,6 +278,8 @@ API Implemented
224
278
* [ ngx.cookie_time] ( https://github.com/openresty/lua-nginx-module#ngxcookie_time )
225
279
* [ ngx.http_time] ( https://github.com/openresty/lua-nginx-module#ngxhttp_time )
226
280
* [ ngx.parse_http_time] ( https://github.com/openresty/lua-nginx-module#ngxparse_http_time )
281
+ * [ monotonic_msec] ( ./lib/resty/core/time.md#monotonic_msec )
282
+ * [ monotonic_time] ( ./lib/resty/core/time.md#monotonic_time )
227
283
228
284
[ Back to TOC] ( #table-of-contents )
229
285
@@ -248,6 +304,20 @@ API Implemented
248
304
249
305
[ Back to TOC] ( #table-of-contents )
250
306
307
+ ## resty.core.socket
308
+
309
+ * [ socket.setoption] ( https://github.com/openresty/lua-nginx-module#tcpsocksetoption )
310
+ * [ socket.setclientcert] ( https://github.com/openresty/lua-nginx-module#tcpsocksetclientcert )
311
+ * [ socket.sslhandshake] ( https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake )
312
+
313
+ [ Back to TOC] ( #table-of-contents )
314
+
315
+ ## resty.core.param
316
+
317
+ * [ ngx.arg] ( https://github.com/openresty/lua-nginx-module#ngxarg ) (getter only)
318
+
319
+ [ Back to TOC] ( #table-of-contents )
320
+
251
321
## ngx.semaphore
252
322
253
323
This Lua module implements a semaphore API for efficient "light thread" synchronization,
@@ -274,6 +344,15 @@ See the [documentation](./lib/ngx/ssl.md) for this Lua module for more details.
274
344
275
345
[ Back to TOC] ( #table-of-contents )
276
346
347
+ ## ngx.ssl.clienthello
348
+
349
+ This Lua module provides a Lua API for post-processing SSL client hello message
350
+ for NGINX downstream SSL connections.
351
+
352
+ See the [ documentation] ( ./lib/ngx/ssl/clienthello.md ) for this Lua module for more details.
353
+
354
+ [ Back to TOC] ( #table-of-contents )
355
+
277
356
## ngx.ssl.session
278
357
279
358
This Lua module provides a Lua API for manipulating SSL session data and IDs
0 commit comments