Mercurial > hg > nginx-site
annotate xml/ru/docs/stream/ngx_stream_js_module.xml @ 2532:423d813dc8bb
Documented support for multi-value headers in r.headersOut.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 23 Apr 2020 12:57:43 +0100 |
parents | 407c5bd5bffc |
children | 617bc29bd759 |
rev | line source |
---|---|
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
2 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
3 <!-- |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
5 --> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
6 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
8 |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
9 <module name="Модуль ngx_stream_js_module" |
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
10 link="/ru/docs/stream/ngx_stream_js_module.html" |
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
11 lang="ru" |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
12 rev="18"> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
13 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
14 <section id="summary"> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
15 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
16 <para> |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
17 Модуль <literal>ngx_stream_js_module</literal> позволяет задавать |
2245
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
18 обработчики на <link doc="../njs/index.xml">njs</link> — |
1844
f56626ce9c40
Changed JavaScript to nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1843
diff
changeset
|
19 подмножестве языка JavaScript. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
20 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
21 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
22 <para> |
2188
523dc4cc8745
Updated installation procedure in njs modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
23 По умолчанию этот модуль не собирается. |
523dc4cc8745
Updated installation procedure in njs modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
24 Инструкция по сборке и установке доступны |
2245
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
25 <link doc="../njs/install.xml">здесь</link>. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
26 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
27 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
28 </section> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
29 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
30 |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
31 <section id="example" name="Пример конфигурации"> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
32 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
33 <para> |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
34 Пример работает начиная с версии |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
35 <link doc="../njs/changes.xml" id="njs0.4.0">0.4.0</link>. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
36 <example> |
2190
dfc49994218c
Updated example in HTTP njs module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2188
diff
changeset
|
37 load_module modules/ngx_stream_js_module.so; |
dfc49994218c
Updated example in HTTP njs module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2188
diff
changeset
|
38 ... |
dfc49994218c
Updated example in HTTP njs module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2188
diff
changeset
|
39 |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
40 stream { |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
41 js_import stream.js; |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
42 |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
43 js_set $bar stream.bar; |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
44 js_set $req_line stream.req_line; |
1858
36cbfff92c6d
Restricted context of js_set directive to http and stream only.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1853
diff
changeset
|
45 |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
46 server { |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
47 listen 12345; |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
48 |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
49 js_preread stream.preread; |
2237
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
50 return $req_line; |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
51 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
52 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
53 server { |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
54 listen 12346; |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
55 |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
56 js_access stream.access; |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
57 proxy_pass 127.0.0.1:8000; |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
58 js_filter stream.header_inject; |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
59 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
60 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
61 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
62 http { |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
63 server { |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
64 listen 8000; |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
65 location / { |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
66 return 200 $http_foo\n; |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
67 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
68 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
69 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
70 </example> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
71 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
72 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
73 <para> |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
74 Файл <path>stream.js</path>: |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
75 <example> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
76 var line = ''; |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
77 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
78 function bar(s) { |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
79 var v = s.variables; |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
80 s.log("hello from bar() handler!"); |
2237
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
81 return "bar-var" + v.remote_port + "; pid=" + v.pid; |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
82 } |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
83 |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
84 function preread(s) { |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
85 s.on('upload', function (data, flags) { |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
86 var n = data.indexOf('\n'); |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
87 if (n != -1) { |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
88 line = data.substr(0, n); |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
89 s.done(); |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
90 } |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
91 }); |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
92 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
93 |
2237
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
94 function req_line(s) { |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
95 return line; |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
96 } |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
97 |
2237
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
98 // Чтение строки HTTP-запроса. |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
99 // Получение байт в 'req' до того как |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
100 // будет прочитана строка запроса. |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
101 // Добавление HTTP-заголовка в запрос клиента |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
102 |
2288
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
103 var my_header = 'Foo: foo'; |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
104 function header_inject(s) { |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
105 var req = ''; |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
106 s.on('upload', function(data, flags) { |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
107 req += data; |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
108 var n = req.search('\n'); |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
109 if (n != -1) { |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
110 var rest = req.substr(n + 1); |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
111 req = req.substr(0, n + 1); |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
112 s.send(req + my_header + '\r\n' + rest, flags); |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
113 s.off('upload'); |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
114 } |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
115 }); |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
116 } |
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
117 |
2237
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
118 function access(s) { |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
119 if (s.remoteAddress.match('^192.*')) { |
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
120 s.abort(); |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
121 return; |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
122 } |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
123 |
2237
5268c13196f2
Documented njs changes triggered by njs-0.2.4.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2190
diff
changeset
|
124 s.allow(); |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
125 } |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
126 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
127 export default {bar, preread, req_line, access}; |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
128 </example> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
129 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
130 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
131 </section> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
132 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
133 |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
134 <section id="directives" name="Директивы"> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
135 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
136 <directive name="js_access"> |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
137 <syntax><value>функция</value> | <value>модуль.функция</value></syntax> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
138 <default/> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
139 <context>stream</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
140 <context>server</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
141 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
142 <para> |
2128
59a3cc84f507
Renamed nginScript to njs
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2026
diff
changeset
|
143 Задаёт функцию njs, которая будет вызываться в |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
144 <link doc="stream_processing.xml" id="access_phase">access</link>-фазе. |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
145 Начиная с <link doc="../njs/changes.xml" id="njs0.4.0">0.4.0</link> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
146 можно ссылаться на функцию модуля. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
147 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
148 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
149 </directive> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
150 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
151 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
152 <directive name="js_filter"> |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
153 <syntax><value>функция</value> | <value>модуль.функция</value></syntax> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
154 <default/> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
155 <context>stream</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
156 <context>server</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
157 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
158 <para> |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
159 Задаёт фильтр данных. |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
160 Начиная с <link doc="../njs/changes.xml" id="njs0.4.0">0.4.0</link> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
161 можно ссылаться на функцию модуля. |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
162 </para> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
163 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
164 </directive> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
165 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
166 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
167 <directive name="js_import"> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
168 <syntax><value>модуль.js</value> | |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
169 <value>имя_экспорта из модуль.js</value></syntax> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
170 <default/> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
171 <context>stream</context> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
172 <appeared-in>0.4.0</appeared-in> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
173 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
174 <para> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
175 Импортирует модуль, позволяющий задавать обработчики location и переменных |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
176 на njs. |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
177 <literal>Имя_экспорта</literal> является пространством имён |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
178 при доступе к функциям модуля. |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
179 Если <literal>имя_экспорта</literal> не задано, |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
180 то пространством имён будет являться имя модуля. |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
181 <example> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
182 js_import stream.js; |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
183 </example> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
184 В примере при доступе к экспорту в качестве |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
185 пространства имён используется имя модуля <literal>stream</literal>. |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
186 Если импортируемый модуль содержит <literal>foo()</literal>, |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
187 то для доступа используется <literal>stream.foo</literal>. |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
188 </para> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
189 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
190 <para> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
191 Директив <literal>js_import</literal> может быть несколько. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
192 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
193 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
194 </directive> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
195 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
196 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
197 <directive name="js_include"> |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
198 <syntax><value>файл</value></syntax> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
199 <default/> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
200 <context>stream</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
201 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
202 <para> |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
203 Задаёт файл, который позволяет задавать обработчики server и переменных на njs: |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
204 <example> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
205 nginx.conf: |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
206 js_include stream.js; |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
207 js_set $js_addr address; |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
208 server { |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
209 listen 127.0.0.1:12345; |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
210 return $js_addr; |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
211 } |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
212 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
213 stream.js: |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
214 function address(s) { |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
215 return s.remoteAddress; |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
216 } |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
217 </example> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
218 </para> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
219 |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
220 <para> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
221 Директива устарела начиная с |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
222 <link doc="../njs/changes.xml" id="njs0.4.0">0.4.0</link>, |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
223 вместо неё следует использовать директиву <link id="js_import"/>. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
224 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
225 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
226 </directive> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
227 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
228 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
229 <directive name="js_preread"> |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
230 <syntax><value>функция</value> | <value>модуль.функция</value></syntax> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
231 <default/> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
232 <context>stream</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
233 <context>server</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
234 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
235 <para> |
2128
59a3cc84f507
Renamed nginScript to njs
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2026
diff
changeset
|
236 Задаёт функцию njs, которая будет вызываться в |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
237 <link doc="stream_processing.xml" id="preread_phase">preread</link>-фазе. |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
238 Начиная с <link doc="../njs/changes.xml" id="njs0.4.0">0.4.0</link> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
239 можно ссылаться на функцию модуля. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
240 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
241 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
242 </directive> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
243 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
244 |
2352
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
245 <directive name="js_path"> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
246 <syntax> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
247 <value>путь</value></syntax> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
248 <default/> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
249 <context>http</context> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
250 <appeared-in>0.3.0</appeared-in> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
251 |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
252 <para> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
253 Задаёт дополнительный путь для модулей njs. |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
254 </para> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
255 |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
256 </directive> |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
257 |
1101e24c6d14
Documented the js_path directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2332
diff
changeset
|
258 |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
259 <directive name="js_set"> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
260 <syntax> |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
261 <value>$переменная</value> <value>функция</value> | |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
262 <value>модуль.функция</value></syntax> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
263 <default/> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
264 <context>stream</context> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
265 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
266 <para> |
2128
59a3cc84f507
Renamed nginScript to njs
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2026
diff
changeset
|
267 Задаёт функцию njs для указанной переменной. |
2530
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
268 Начиная с <link doc="../njs/changes.xml" id="njs0.4.0">0.4.0</link> |
407c5bd5bffc
Documented the js_import directive and corresponding changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2352
diff
changeset
|
269 можно ссылаться на функцию модуля. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
270 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
271 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
272 </directive> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
273 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
274 </section> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
275 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
276 |
1843
3492eb9b8138
Translated http and stream js modules into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1840
diff
changeset
|
277 <section id="properties" name="Свойства объекта сессии"> |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
278 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
279 <para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2135
diff
changeset
|
280 Каждый stream-обработчик njs получает один аргумент, |
2288
786e96c52c7a
Corrected links and example in Russian http and stream js modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
281 <link doc="../njs/reference.xml" id="stream">объект</link> stream-сессии. |
1840
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
282 </para> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
283 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
284 </section> |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
285 |
15632fc2d548
Documented http and stream nginScript modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
286 </module> |