comparison xml/en/docs/stream/ngx_stream_js_module.xml @ 2175:cd4889fdcfa4

Moved njs HTTP and Stream API to a separate page.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 05 Jun 2018 18:22:00 +0300
parents 6c7841469ec5
children 523dc4cc8745
comparison
equal deleted inserted replaced
2174:3b782a679237 2175:cd4889fdcfa4
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8 8
9 <module name="Module ngx_stream_js_module" 9 <module name="Module ngx_stream_js_module"
10 link="/en/docs/stream/ngx_stream_js_module.html" 10 link="/en/docs/stream/ngx_stream_js_module.html"
11 lang="en" 11 lang="en"
12 rev="10"> 12 rev="11">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 The <literal>ngx_stream_js_module</literal> module is used to implement 17 The <literal>ngx_stream_js_module</literal> module is used to implement
228 228
229 </section> 229 </section>
230 230
231 231
232 <section id="properties" name="Session Object Properties"> 232 <section id="properties" name="Session Object Properties">
233 <para> 233
234 Each stream njs handler receives one argument, a stream session object. 234 <para>
235 </para> 235 Each stream njs handler receives one argument, a stream session
236 236 <link doc="../njs/njs_api.xml" id="stream_session">object</link>.
237 <para>
238 The session object has the following properties:
239
240 <list type="tag">
241
242 <tag-name><literal>remoteAddress</literal></tag-name>
243 <tag-desc>
244 client address, read-only
245 </tag-desc>
246
247 <tag-name><literal>eof</literal></tag-name>
248 <tag-desc>
249 a boolean read-only property, true if the current buffer is the last buffer
250 </tag-desc>
251
252 <tag-name><literal>fromUpstream</literal></tag-name>
253 <tag-desc>
254 a boolean read-only property,
255 true if the current buffer is from the upstream server to the client
256 </tag-desc>
257
258 <tag-name><literal>buffer</literal></tag-name>
259 <tag-desc>
260 the current buffer, writable
261 </tag-desc>
262
263 <tag-name><literal>variables{}</literal></tag-name>
264 <tag-desc>
265 nginx variables object, read-only
266 </tag-desc>
267
268 <tag-name><literal>OK</literal></tag-name>
269 <tag-desc>
270 the <literal>OK</literal> return code
271 </tag-desc>
272
273 <tag-name><literal>DECLINED</literal></tag-name>
274 <tag-desc>
275 the <literal>DECLINED</literal> return code
276 </tag-desc>
277
278 <tag-name><literal>AGAIN</literal></tag-name>
279 <tag-desc>
280 the <literal>AGAIN</literal> return code
281 </tag-desc>
282
283 <tag-name><literal>ERROR</literal></tag-name>
284 <tag-desc>
285 the <literal>ERROR</literal> return code
286 </tag-desc>
287
288 <tag-name><literal>ABORT</literal></tag-name>
289 <tag-desc>
290 the <literal>ABORT</literal> return code
291 </tag-desc>
292 </list>
293 </para>
294
295 <para>
296 The session object has the following methods:
297
298 <list type="tag">
299
300 <tag-name><literal>log(<value>string</value>)</literal></tag-name>
301 <tag-desc>
302 writes a sent <value>string</value> to the error log
303 on the <literal>info</literal> level of logging
304 </tag-desc>
305 </list>
306 </para> 237 </para>
307 238
308 </section> 239 </section>
309 240
310 </module> 241 </module>