~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to doc/html-main/Nethttpd_services.html

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
<link title="Index of modules" rel=Appendix href="index_modules.html">
18
18
<link title="Index of module types" rel=Appendix href="index_module_types.html">
19
19
<link title="Uq_gtk" rel="Chapter" href="Uq_gtk.html">
 
20
<link title="Uq_ssl" rel="Chapter" href="Uq_ssl.html">
 
21
<link title="Https_client" rel="Chapter" href="Https_client.html">
 
22
<link title="Uq_tcl" rel="Chapter" href="Uq_tcl.html">
20
23
<link title="Equeue" rel="Chapter" href="Equeue.html">
21
24
<link title="Unixqueue" rel="Chapter" href="Unixqueue.html">
 
25
<link title="Unixqueue_pollset" rel="Chapter" href="Unixqueue_pollset.html">
 
26
<link title="Unixqueue_select" rel="Chapter" href="Unixqueue_select.html">
 
27
<link title="Uq_resolver" rel="Chapter" href="Uq_resolver.html">
22
28
<link title="Uq_engines" rel="Chapter" href="Uq_engines.html">
23
29
<link title="Uq_socks5" rel="Chapter" href="Uq_socks5.html">
24
 
<link title="Unixqueue_mt" rel="Chapter" href="Unixqueue_mt.html">
 
30
<link title="Uq_io" rel="Chapter" href="Uq_io.html">
 
31
<link title="Uq_lwt" rel="Chapter" href="Uq_lwt.html">
 
32
<link title="Uq_libevent" rel="Chapter" href="Uq_libevent.html">
25
33
<link title="Equeue_intro" rel="Chapter" href="Equeue_intro.html">
26
 
<link title="Uq_ssl" rel="Chapter" href="Uq_ssl.html">
27
 
<link title="Uq_tcl" rel="Chapter" href="Uq_tcl.html">
 
34
<link title="Netcamlbox" rel="Chapter" href="Netcamlbox.html">
 
35
<link title="Netcgi_apache" rel="Chapter" href="Netcgi_apache.html">
 
36
<link title="Netcgi_modtpl" rel="Chapter" href="Netcgi_modtpl.html">
 
37
<link title="Netcgi_plex" rel="Chapter" href="Netcgi_plex.html">
28
38
<link title="Netcgi_common" rel="Chapter" href="Netcgi_common.html">
29
39
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
30
40
<link title="Netcgi_ajp" rel="Chapter" href="Netcgi_ajp.html">
35
45
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html">
36
46
<link title="Netcgi_test" rel="Chapter" href="Netcgi_test.html">
37
47
<link title="Netcgi_porting" rel="Chapter" href="Netcgi_porting.html">
38
 
<link title="Netcgi_plex" rel="Chapter" href="Netcgi_plex.html">
 
48
<link title="Http_client_conncache" rel="Chapter" href="Http_client_conncache.html">
39
49
<link title="Http_client" rel="Chapter" href="Http_client.html">
40
50
<link title="Telnet_client" rel="Chapter" href="Telnet_client.html">
41
51
<link title="Ftp_data_endpoint" rel="Chapter" href="Ftp_data_endpoint.html">
42
52
<link title="Ftp_client" rel="Chapter" href="Ftp_client.html">
 
53
<link title="Http_fs" rel="Chapter" href="Http_fs.html">
 
54
<link title="Ftp_fs" rel="Chapter" href="Ftp_fs.html">
 
55
<link title="Netclient_tut" rel="Chapter" href="Netclient_tut.html">
 
56
<link title="Netgssapi" rel="Chapter" href="Netgssapi.html">
43
57
<link title="Nethttpd_types" rel="Chapter" href="Nethttpd_types.html">
44
58
<link title="Nethttpd_kernel" rel="Chapter" href="Nethttpd_kernel.html">
45
59
<link title="Nethttpd_reactor" rel="Chapter" href="Nethttpd_reactor.html">
46
60
<link title="Nethttpd_engine" rel="Chapter" href="Nethttpd_engine.html">
47
61
<link title="Nethttpd_services" rel="Chapter" href="Nethttpd_services.html">
48
62
<link title="Nethttpd_plex" rel="Chapter" href="Nethttpd_plex.html">
 
63
<link title="Nethttpd_util" rel="Chapter" href="Nethttpd_util.html">
49
64
<link title="Nethttpd_intro" rel="Chapter" href="Nethttpd_intro.html">
 
65
<link title="Netmech_scram" rel="Chapter" href="Netmech_scram.html">
 
66
<link title="Netmech_scram_gssapi" rel="Chapter" href="Netmech_scram_gssapi.html">
 
67
<link title="Netmcore" rel="Chapter" href="Netmcore.html">
 
68
<link title="Netmcore_camlbox" rel="Chapter" href="Netmcore_camlbox.html">
 
69
<link title="Netmcore_mempool" rel="Chapter" href="Netmcore_mempool.html">
 
70
<link title="Netmcore_heap" rel="Chapter" href="Netmcore_heap.html">
 
71
<link title="Netmcore_ref" rel="Chapter" href="Netmcore_ref.html">
 
72
<link title="Netmcore_array" rel="Chapter" href="Netmcore_array.html">
 
73
<link title="Netmcore_sem" rel="Chapter" href="Netmcore_sem.html">
 
74
<link title="Netmcore_mutex" rel="Chapter" href="Netmcore_mutex.html">
 
75
<link title="Netmcore_condition" rel="Chapter" href="Netmcore_condition.html">
 
76
<link title="Netmcore_queue" rel="Chapter" href="Netmcore_queue.html">
 
77
<link title="Netmcore_buffer" rel="Chapter" href="Netmcore_buffer.html">
 
78
<link title="Netmcore_matrix" rel="Chapter" href="Netmcore_matrix.html">
 
79
<link title="Netmcore_hashtbl" rel="Chapter" href="Netmcore_hashtbl.html">
 
80
<link title="Netmcore_process" rel="Chapter" href="Netmcore_process.html">
 
81
<link title="Netmcore_tut" rel="Chapter" href="Netmcore_tut.html">
50
82
<link title="Netplex_types" rel="Chapter" href="Netplex_types.html">
51
83
<link title="Netplex_mp" rel="Chapter" href="Netplex_mp.html">
52
84
<link title="Netplex_mt" rel="Chapter" href="Netplex_mt.html">
60
92
<link title="Netplex_kit" rel="Chapter" href="Netplex_kit.html">
61
93
<link title="Rpc_netplex" rel="Chapter" href="Rpc_netplex.html">
62
94
<link title="Netplex_cenv" rel="Chapter" href="Netplex_cenv.html">
 
95
<link title="Netplex_semaphore" rel="Chapter" href="Netplex_semaphore.html">
 
96
<link title="Netplex_sharedvar" rel="Chapter" href="Netplex_sharedvar.html">
 
97
<link title="Netplex_mutex" rel="Chapter" href="Netplex_mutex.html">
 
98
<link title="Netplex_encap" rel="Chapter" href="Netplex_encap.html">
63
99
<link title="Netplex_intro" rel="Chapter" href="Netplex_intro.html">
 
100
<link title="Netplex_advanced" rel="Chapter" href="Netplex_advanced.html">
 
101
<link title="Netplex_admin" rel="Chapter" href="Netplex_admin.html">
64
102
<link title="Netshm" rel="Chapter" href="Netshm.html">
65
103
<link title="Netshm_data" rel="Chapter" href="Netshm_data.html">
66
104
<link title="Netshm_hashtbl" rel="Chapter" href="Netshm_hashtbl.html">
83
121
<link title="Nethtml" rel="Chapter" href="Nethtml.html">
84
122
<link title="Netstring_str" rel="Chapter" href="Netstring_str.html">
85
123
<link title="Netstring_pcre" rel="Chapter" href="Netstring_pcre.html">
86
 
<link title="Netstring_mt" rel="Chapter" href="Netstring_mt.html">
87
124
<link title="Netmappings" rel="Chapter" href="Netmappings.html">
88
125
<link title="Netaux" rel="Chapter" href="Netaux.html">
89
126
<link title="Nethttp" rel="Chapter" href="Nethttp.html">
 
127
<link title="Netpagebuffer" rel="Chapter" href="Netpagebuffer.html">
 
128
<link title="Netfs" rel="Chapter" href="Netfs.html">
 
129
<link title="Netglob" rel="Chapter" href="Netglob.html">
 
130
<link title="Netauth" rel="Chapter" href="Netauth.html">
 
131
<link title="Netsockaddr" rel="Chapter" href="Netsockaddr.html">
 
132
<link title="Netnumber" rel="Chapter" href="Netnumber.html">
 
133
<link title="Rtypes" rel="Chapter" href="Rtypes.html">
 
134
<link title="Xdr_mstring" rel="Chapter" href="Xdr_mstring.html">
 
135
<link title="Xdr" rel="Chapter" href="Xdr.html">
 
136
<link title="Netcompression" rel="Chapter" href="Netcompression.html">
90
137
<link title="Netchannels_tut" rel="Chapter" href="Netchannels_tut.html">
91
138
<link title="Netmime_tut" rel="Chapter" href="Netmime_tut.html">
92
139
<link title="Netsendmail_tut" rel="Chapter" href="Netsendmail_tut.html">
93
140
<link title="Netulex_tut" rel="Chapter" href="Netulex_tut.html">
94
141
<link title="Neturl_tut" rel="Chapter" href="Neturl_tut.html">
95
142
<link title="Netsys" rel="Chapter" href="Netsys.html">
 
143
<link title="Netsys_posix" rel="Chapter" href="Netsys_posix.html">
 
144
<link title="Netsys_pollset" rel="Chapter" href="Netsys_pollset.html">
 
145
<link title="Netlog" rel="Chapter" href="Netlog.html">
 
146
<link title="Netexn" rel="Chapter" href="Netexn.html">
 
147
<link title="Netsys_win32" rel="Chapter" href="Netsys_win32.html">
 
148
<link title="Netsys_pollset_posix" rel="Chapter" href="Netsys_pollset_posix.html">
 
149
<link title="Netsys_pollset_win32" rel="Chapter" href="Netsys_pollset_win32.html">
 
150
<link title="Netsys_pollset_generic" rel="Chapter" href="Netsys_pollset_generic.html">
 
151
<link title="Netsys_signal" rel="Chapter" href="Netsys_signal.html">
 
152
<link title="Netsys_oothr" rel="Chapter" href="Netsys_oothr.html">
 
153
<link title="Netsys_xdr" rel="Chapter" href="Netsys_xdr.html">
 
154
<link title="Netsys_rng" rel="Chapter" href="Netsys_rng.html">
 
155
<link title="Netsys_types" rel="Chapter" href="Netsys_types.html">
 
156
<link title="Netsys_mem" rel="Chapter" href="Netsys_mem.html">
 
157
<link title="Netsys_tmp" rel="Chapter" href="Netsys_tmp.html">
 
158
<link title="Netgzip" rel="Chapter" href="Netgzip.html">
96
159
<link title="Netpop" rel="Chapter" href="Netpop.html">
97
160
<link title="Rpc_auth_dh" rel="Chapter" href="Rpc_auth_dh.html">
98
161
<link title="Rpc_key_service" rel="Chapter" href="Rpc_key_service.html">
99
162
<link title="Rpc_time" rel="Chapter" href="Rpc_time.html">
100
163
<link title="Rpc_auth_local" rel="Chapter" href="Rpc_auth_local.html">
101
 
<link title="Rtypes" rel="Chapter" href="Rtypes.html">
102
 
<link title="Xdr" rel="Chapter" href="Xdr.html">
 
164
<link title="Rpc_ssl" rel="Chapter" href="Rpc_ssl.html">
 
165
<link title="Rpc_xti_client" rel="Chapter" href="Rpc_xti_client.html">
103
166
<link title="Rpc" rel="Chapter" href="Rpc.html">
104
167
<link title="Rpc_program" rel="Chapter" href="Rpc_program.html">
 
168
<link title="Rpc_util" rel="Chapter" href="Rpc_util.html">
105
169
<link title="Rpc_portmapper_aux" rel="Chapter" href="Rpc_portmapper_aux.html">
106
170
<link title="Rpc_packer" rel="Chapter" href="Rpc_packer.html">
107
171
<link title="Rpc_transport" rel="Chapter" href="Rpc_transport.html">
111
175
<link title="Rpc_portmapper" rel="Chapter" href="Rpc_portmapper.html">
112
176
<link title="Rpc_server" rel="Chapter" href="Rpc_server.html">
113
177
<link title="Rpc_auth_sys" rel="Chapter" href="Rpc_auth_sys.html">
 
178
<link title="Rpc_auth_gssapi" rel="Chapter" href="Rpc_auth_gssapi.html">
 
179
<link title="Rpc_proxy" rel="Chapter" href="Rpc_proxy.html">
114
180
<link title="Rpc_intro" rel="Chapter" href="Rpc_intro.html">
115
181
<link title="Rpc_mapping_ref" rel="Chapter" href="Rpc_mapping_ref.html">
116
 
<link title="Rpc_ssl" rel="Chapter" href="Rpc_ssl.html">
117
 
<link title="Rpc_xti_client" rel="Chapter" href="Rpc_xti_client.html">
 
182
<link title="Rpc_intro_gss" rel="Chapter" href="Rpc_intro_gss.html">
118
183
<link title="Shell_sys" rel="Chapter" href="Shell_sys.html">
119
184
<link title="Shell" rel="Chapter" href="Shell.html">
120
185
<link title="Shell_uq" rel="Chapter" href="Shell_uq.html">
121
 
<link title="Shell_mt" rel="Chapter" href="Shell_mt.html">
 
186
<link title="Shell_fs" rel="Chapter" href="Shell_fs.html">
122
187
<link title="Shell_intro" rel="Chapter" href="Shell_intro.html">
123
 
<link title="Netsmtp" rel="Chapter" href="Netsmtp.html"><title>Ocamlnet 2 Reference Manual : Nethttpd_services</title>
 
188
<link title="Netsmtp" rel="Chapter" href="Netsmtp.html">
 
189
<link title="Intro" rel="Chapter" href="Intro.html">
 
190
<link title="Platform" rel="Chapter" href="Platform.html">
 
191
<link title="Foreword" rel="Chapter" href="Foreword.html">
 
192
<link title="Ipv6" rel="Chapter" href="Ipv6.html"><title>Ocamlnet 3 Reference Manual : Nethttpd_services</title>
124
193
</head>
125
194
<body>
126
195
<div class="navbar"><a href="Nethttpd_engine.html">Previous</a>
129
198
</div>
130
199
<center><h1>Module <a href="type_Nethttpd_services.html">Nethttpd_services</a></h1></center>
131
200
<br>
132
 
<pre><span class="keyword">module</span> Nethttpd_services: <code class="code">sig</code> <a href="Nethttpd_services.html">..</a> <code class="code">end</code></pre><a name="1_ServiceProvidersforHTTPdaemon"></a>
133
 
<h1>Service Providers for HTTP daemon</h1>
 
201
<pre><span class="keyword">module</span> Nethttpd_services: <code class="code">sig</code> <a href="Nethttpd_services.html">..</a> <code class="code">end</code></pre><span id="1_ServiceProvidersforHTTPdaemon"><h1>Service Providers for HTTP daemon</h1></span>
134
202
<p>
135
203
 
136
204
 This module defines the basic service providers that handle requests and
137
205
 generate responses. The service providers can be used with both the
138
206
 reactive and the event-based daemon encapsulations.<br>
139
207
<hr width="100%">
140
 
<br><code><span class="keyword">type</span> <a name="TYPEhost"></a><code class="type"></code>host = {</code><table class="typetable">
 
208
<br><code><span id="TYPEhost"><span class="keyword">type</span> <code class="type"></code>host</span> = {</code><table class="typetable">
141
209
<tr>
142
210
<td align="left" valign="top" >
143
211
<code>&nbsp;&nbsp;</code></td>
191
259
 or <code class="code">server_addresses</code>, or if this does not succeed, to the real port number.<br>
192
260
</div>
193
261
 
194
 
<pre><span class="keyword">type</span> <a name="TYPEhost_distributor"></a><code class="type">'a</code> host_distributor = <code class="type">(<a href="Nethttpd_services.html#TYPEhost">host</a> * 'a <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a>) list</code> </pre>
 
262
<pre><span id="TYPEhost_distributor"><span class="keyword">type</span> <code class="type">'a</code> host_distributor</span> = <code class="type">(<a href="Nethttpd_services.html#TYPEhost">host</a> * 'a <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a>) list</code> </pre>
195
263
<div class="info">
196
264
Describes virtual hosting by pairs <code class="code">(host,service)</code>: If <code class="code">host</code> matches the
197
265
 incoming request, the corresponding <code class="code">service</code> is performed to generate the
198
266
 response.<br>
199
267
</div>
200
268
 
201
 
<pre><span class="keyword">val</span> <a name="VALhost_distributor"></a>host_distributor : <code class="type">'a <a href="Nethttpd_services.html#TYPEhost_distributor">host_distributor</a> -><br>       [> `Host_distributor of 'a <a href="Nethttpd_services.html#TYPEhost_distributor">host_distributor</a> ]<br>       <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
269
<pre><span id="VALhost_distributor"><span class="keyword">val</span> host_distributor</span> : <code class="type">'a <a href="Nethttpd_services.html#TYPEhost_distributor">host_distributor</a> -><br>       [> `Host_distributor of 'a <a href="Nethttpd_services.html#TYPEhost_distributor">host_distributor</a> ]<br>       <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
202
270
Configures virtual hosting<br>
203
271
</div>
204
 
<pre><span class="keyword">val</span> <a name="VALdefault_host"></a>default_host : <code class="type">?pref_name:string -> ?pref_port:int -> unit -> <a href="Nethttpd_services.html#TYPEhost">host</a></code></pre><div class="info">
 
272
<pre><span id="VALdefault_host"><span class="keyword">val</span> default_host</span> : <code class="type">?pref_name:string -> ?pref_port:int -> unit -> <a href="Nethttpd_services.html#TYPEhost">host</a></code></pre><div class="info">
205
273
Creates a <code class="code">host</code> record that matches any request. <code class="code">pref_name</code> and <code class="code">pref_port</code>
206
274
 can be used to specify preferred names.<br>
207
275
</div>
208
 
<pre><span class="keyword">val</span> <a name="VALoptions_service"></a>options_service : <code class="type">unit -> [> `Options_service ] <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
276
<pre><span id="VALoptions_service"><span class="keyword">val</span> options_service</span> : <code class="type">unit -> [> `Options_service ] <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
209
277
This service responds to "OPTIONS *" requests, and nothing else<br>
210
278
</div>
211
 
<pre><span class="keyword">type</span> <a name="TYPEuri_distributor"></a><code class="type">'a</code> uri_distributor = <code class="type">(string * 'a <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a>) list</code> </pre>
 
279
<pre><span id="TYPEuri_distributor"><span class="keyword">type</span> <code class="type">'a</code> uri_distributor</span> = <code class="type">(string * 'a <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a>) list</code> </pre>
212
280
<div class="info">
213
281
Describes that services are bound to URI prefixes. The strings are URI paths
214
282
 (without URI escaping).
225
293
 a slash.<br>
226
294
</div>
227
295
 
228
 
<pre><span class="keyword">val</span> <a name="VALuri_distributor"></a>uri_distributor : <code class="type">'a <a href="Nethttpd_services.html#TYPEuri_distributor">uri_distributor</a> -><br>       [> `Uri_distributor of 'a <a href="Nethttpd_services.html#TYPEuri_distributor">uri_distributor</a> ]<br>       <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
296
<pre><span id="VALuri_distributor"><span class="keyword">val</span> uri_distributor</span> : <code class="type">'a <a href="Nethttpd_services.html#TYPEuri_distributor">uri_distributor</a> -><br>       [> `Uri_distributor of 'a <a href="Nethttpd_services.html#TYPEuri_distributor">uri_distributor</a> ]<br>       <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
229
297
Configures URI distribution. The incoming request URI is normalized before
230
298
 being matched, and the request is rewritten to the normalized URI.
231
299
<p>
237
305
 
238
306
 If the path starts with <code class="code">..</code> after normalization, the request is rejected.<br>
239
307
</div>
240
 
<pre><span class="keyword">type</span> <a name="TYPElinear_distributor"></a><code class="type">'a</code> linear_distributor = <code class="type">((<a href="Nethttpd_types.extended_environment.html">Nethttpd_types.extended_environment</a> -> bool) *<br>        'a <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a>)<br>       list</code> </pre>
 
308
<pre><span id="TYPElinear_distributor"><span class="keyword">type</span> <code class="type">'a</code> linear_distributor</span> = <code class="type">((<a href="Nethttpd_types.extended_environment-c.html">Nethttpd_types.extended_environment</a> -> bool) *<br>        'a <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a>)<br>       list</code> </pre>
241
309
<div class="info">
242
310
Services are selected by calling the selector function. The first service
243
311
 for which the function returns <code class="code">true</code> is selected.<br>
244
312
</div>
245
313
 
246
 
<pre><span class="keyword">val</span> <a name="VALlinear_distributor"></a>linear_distributor : <code class="type">'a <a href="Nethttpd_services.html#TYPElinear_distributor">linear_distributor</a> -><br>       [> `Linear_distributor of 'a <a href="Nethttpd_services.html#TYPElinear_distributor">linear_distributor</a> ]<br>       <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
314
<pre><span id="VALlinear_distributor"><span class="keyword">val</span> linear_distributor</span> : <code class="type">'a <a href="Nethttpd_services.html#TYPElinear_distributor">linear_distributor</a> -><br>       [> `Linear_distributor of 'a <a href="Nethttpd_services.html#TYPElinear_distributor">linear_distributor</a> ]<br>       <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
247
315
Configures linear distribution<br>
248
316
</div>
249
 
<pre><span class="keyword">type</span> <a name="TYPEmethod_filter"></a><code class="type"></code>method_filter = <code class="type">[ `Limit of string list | `Limit_except of string list ]</code> </pre>
 
317
<pre><span id="TYPEmethod_filter"><span class="keyword">type</span> <code class="type"></code>method_filter</span> = <code class="type">[ `Limit of string list | `Limit_except of string list ]</code> </pre>
250
318
<div class="info">
251
319
The request is only accepted if listed (for <code class="code">`Limit</code>), or if not listed
252
320
 (for <code class="code">`Limit_except</code>).<br>
253
321
</div>
254
322
 
255
 
<pre><span class="keyword">type</span> <a name="TYPEmethod_distributor"></a><code class="type">'a</code> method_distributor = <code class="type">(<a href="Nethttpd_services.html#TYPEmethod_filter">method_filter</a> * 'a <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a>) list</code> </pre>
 
323
<pre><span id="TYPEmethod_distributor"><span class="keyword">type</span> <code class="type">'a</code> method_distributor</span> = <code class="type">(<a href="Nethttpd_services.html#TYPEmethod_filter">method_filter</a> * 'a <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a>) list</code> </pre>
256
324
<div class="info">
257
325
The first service is selected for which the method filter accepts the request<br>
258
326
</div>
259
327
 
260
 
<pre><span class="keyword">val</span> <a name="VALmethod_distributor"></a>method_distributor : <code class="type">'a <a href="Nethttpd_services.html#TYPEmethod_distributor">method_distributor</a> -><br>       [> `Method_distributor of 'a <a href="Nethttpd_services.html#TYPEmethod_distributor">method_distributor</a> ]<br>       <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
328
<pre><span id="VALmethod_distributor"><span class="keyword">val</span> method_distributor</span> : <code class="type">'a <a href="Nethttpd_services.html#TYPEmethod_distributor">method_distributor</a> -><br>       [> `Method_distributor of 'a <a href="Nethttpd_services.html#TYPEmethod_distributor">method_distributor</a> ]<br>       <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
261
329
Configures method distribution<br>
262
330
</div>
263
 
<pre><span class="keyword">type</span> <a name="TYPEfile_option"></a><code class="type"></code>file_option = <code class="type">[ `Enable_gzip<br>       | `Enable_index_file of string list<br>       | `Enable_listings of<br>           <a href="Nethttpd_types.extended_environment.html">Nethttpd_types.extended_environment</a> -><br>           <a href="Netcgi1_compat.Netcgi_types.cgi_activation.html">Netcgi1_compat.Netcgi_types.cgi_activation</a> -><br>           <a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -> unit ]</code> </pre>
 
331
<pre><span id="TYPEfile_option"><span class="keyword">type</span> <code class="type"></code>file_option</span> = <code class="type">[ `Enable_cooked_compression<br>       | `Enable_gzip<br>       | `Enable_index_file of string list<br>       | `Enable_listings of<br>           <a href="Nethttpd_types.extended_environment-c.html">Nethttpd_types.extended_environment</a> -><br>           <a href="Netcgi.cgi_activation-c.html">Netcgi.cgi_activation</a> -> <a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -> unit<br>       | `Override_compression_suffixes of (string * string) list ]</code> </pre>
264
332
<div class="info">
265
333
Add-on features for file services:<ul>
266
 
<li><code class="code">`Enable_gzip</code>: If enabled, files ending in <code class="code">.gz</code> are assumed to be in <code class="code">gzip</code> 
267
 
   compression. When there is <b>both</b> the base file and the gzip file ending in
268
 
   <code class="code">.gz</code>, accesses to the base file (!) are transmitted with <code class="code">gzip</code>
269
 
   compression.</li>
 
334
<li><code class="code">`Enable_gzip</code>: Deprecated. Same as <code class="code">`Enable_cooked_compression</code>.</li>
 
335
<li><code class="code">`Enable_cooked_compression</code>: Modifies the way compressed files
 
336
   are handled. Normally it is required that one accesses the compressed
 
337
   file (with suffix such as "gz") directly to get it in compressed form.
 
338
   If this option is enabled, though, the server also compresses
 
339
   the base file (without suffix such as "gz"), but only if the
 
340
   base file is accompanied by a compressed version (with suffix).
 
341
   E.g. if there is "foo" and "foo.gz", this enables that the accesses
 
342
   to "foo" can make use of compression.</li>
270
343
<li><code class="code">`Enable_index_file</code>: If enabled, accesses to directories are redirected
271
344
   to index files. The possible file names are given in the string list.
272
345
   E.g. <code class="code">`Enable_index_file ["index.html"; "index.htm"]</code>. It is redirected to
275
348
   the argument function. The <code class="code">PATH_TRANSLATED</code> property of the environment
276
349
   contains the absolute name of the directory to list. The <code class="code">PATH_INFO</code> property
277
350
   is the corresponding URI path. <code class="code">SCRIPT_NAME</code> is meaningless.</li>
 
351
<li><code class="code">`Override_compression_suffixes l</code>: Tags the file suffixes in
 
352
   <code class="code">l</code> as compression schemes. A pair <code class="code">(suffix,ce)</code> sets that the
 
353
   <code class="code">suffix</code> means the content encoding <code class="code">ce</code>. Knowing this is important
 
354
   for determining the media type of the file.</li>
278
355
</ul>
279
356
<br>
280
357
</div>
281
358
 
282
 
<br><code><span class="keyword">type</span> <a name="TYPEfile_service"></a><code class="type"></code>file_service = {</code><table class="typetable">
 
359
<br><code><span id="TYPEfile_service"><span class="keyword">type</span> <code class="type"></code>file_service</span> = {</code><table class="typetable">
283
360
<tr>
284
361
<td align="left" valign="top" >
285
362
<code>&nbsp;&nbsp;</code></td>
321
398
Describes a file service<br>
322
399
</div>
323
400
 
324
 
<pre><span class="keyword">val</span> <a name="VALfile_service"></a>file_service : <code class="type"><a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -><br>       [> `File_service of <a href="Nethttpd_services.html#TYPEfile_service">file_service</a> ]<br>       <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
401
<pre><span id="VALfile_service"><span class="keyword">val</span> file_service</span> : <code class="type"><a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -><br>       [> `File_service of <a href="Nethttpd_services.html#TYPEfile_service">file_service</a> ]<br>       <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
325
402
Configures a file service<br>
326
403
</div>
327
 
<pre><span class="keyword">val</span> <a name="VALfile_translator"></a>file_translator : <code class="type"><a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -> string -> string</code></pre><div class="info">
328
 
Translates an URI path to a file name. Raises <code class="code">Not_found</code> if not possible.<br>
 
404
<pre><span id="VALfile_translator"><span class="keyword">val</span> file_translator</span> : <code class="type"><a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -> string -> string</code></pre><div class="info">
 
405
Translates an URI path to a file name. Raises <code class="code">Not_found</code> if not
 
406
      possible. It is not checked whether the resulting file exists.
 
407
<p>
 
408
 
 
409
      This function removes a trailing slash of the translated path, if any,
 
410
      and if resulting from appending the path info component.
 
411
      Trailing slashes must not be used to deduce that directories are
 
412
      accessed.<br>
329
413
</div>
330
 
<pre><span class="keyword">val</span> <a name="VALsimple_listing"></a>simple_listing : <code class="type">?hide:string list -><br>       <a href="Nethttpd_types.extended_environment.html">Nethttpd_types.extended_environment</a> -><br>       <a href="Netcgi1_compat.Netcgi_types.cgi_activation.html">Netcgi1_compat.Netcgi_types.cgi_activation</a> -><br>       <a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -> unit</code></pre><div class="info">
 
414
<pre><span id="VALsimple_listing"><span class="keyword">val</span> simple_listing</span> : <code class="type">?hide:string list -><br>       <a href="Nethttpd_types.extended_environment-c.html">Nethttpd_types.extended_environment</a> -><br>       <a href="Netcgi.cgi_activation-c.html">Netcgi.cgi_activation</a> -> <a href="Nethttpd_services.html#TYPEfile_service">file_service</a> -> unit</code></pre><div class="info">
331
415
Simple listing generator for <code class="code">`Enable_listings</code> 
332
416
<p>
333
417
 
334
 
 <code class="code">hide</code>: An optional list of PCRE regular expressions. File names matching one
 
418
 <code class="code">hide</code>: An optional list of Str regular expressions. File names matching one
335
419
 of the regexps are hidden in the listing. Defaults to hiding files starting with
336
 
 a dot, and files ending in a tilde character.<br>
 
420
 a dot, and files ending in a tilde character. (Changed in Ocamlnet-3.3:
 
421
 <code class="code">hide</code> uses now Str regexps, and no longer PCRE regexps.)<br>
337
422
</div>
338
 
<br><code><span class="keyword">type</span> <a name="TYPEstd_activation_options"></a><code class="type"></code>std_activation_options = {</code><table class="typetable">
 
423
<br><code><span id="TYPEstd_activation_options"><span class="keyword">type</span> <code class="type"></code>std_activation_options</span> = {</code><table class="typetable">
339
424
<tr>
340
425
<td align="left" valign="top" >
341
426
<code>&nbsp;&nbsp;</code></td>
342
427
<td align="left" valign="top" >
343
 
<code>stdactv_processing&nbsp;: <code class="type">(string -> <a href="Netmime.mime_header.html">Netmime.mime_header</a> -> <a href="Netcgi1_compat.Netcgi.html#TYPEargument_processing">Netcgi1_compat.Netcgi.argument_processing</a>)<br>       option</code>;</code></td>
 
428
<code>stdactv_processing&nbsp;: <code class="type"><a href="Netcgi.html#TYPEarg_store">Netcgi.arg_store</a> option</code>;</code></td>
344
429
 
345
430
</tr>
346
431
<tr>
347
432
<td align="left" valign="top" >
348
433
<code>&nbsp;&nbsp;</code></td>
349
434
<td align="left" valign="top" >
350
 
<code>stdactv_operating_type&nbsp;: <code class="type"><a href="Netcgi1_compat.Netcgi.html#TYPEoperating_type">Netcgi1_compat.Netcgi.operating_type</a> option</code>;</code></td>
 
435
<code>stdactv_operating_type&nbsp;: <code class="type"><a href="Netcgi.html#TYPEoutput_type">Netcgi.output_type</a> option</code>;</code></td>
351
436
 
352
437
</tr></table>
353
438
}
357
442
 module.<br>
358
443
</div>
359
444
 
360
 
<pre><span class="keyword">type</span> <a name="TYPEstd_activation"></a><code class="type"></code>std_activation = <code class="type">[ `Std_activation of <a href="Nethttpd_services.html#TYPEstd_activation_options">std_activation_options</a><br>       | `Std_activation_buffered<br>       | `Std_activation_tempfile<br>       | `Std_activation_unbuffered ]</code> </pre>
 
445
<pre><span id="TYPEstd_activation"><span class="keyword">type</span> <code class="type"></code>std_activation</span> = <code class="type">[ `Std_activation of <a href="Nethttpd_services.html#TYPEstd_activation_options">std_activation_options</a><br>       | `Std_activation_buffered<br>       | `Std_activation_tempfile<br>       | `Std_activation_unbuffered ]</code> </pre>
361
446
<div class="info">
362
447
The way the <code class="code">Netcgi_types.cgi_activation</code> object is created. For typical
363
448
 usage, just take:<ul>
376
461
<br>
377
462
</div>
378
463
 
379
 
<br><code><span class="keyword">type</span> <a name="TYPEdynamic_service"></a><code class="type">#<a href="Netcgi1_compat.Netcgi_types.cgi_activation.html">Netcgi1_compat.Netcgi_types.cgi_activation</a></code> dynamic_service = {</code><table class="typetable">
 
464
<br><code><span id="TYPEdynamic_service"><span class="keyword">type</span> <code class="type">#<a href="Netcgi.cgi_activation-c.html">Netcgi.cgi_activation</a></code> dynamic_service</span> = {</code><table class="typetable">
380
465
<tr>
381
466
<td align="left" valign="top" >
382
467
<code>&nbsp;&nbsp;</code></td>
383
468
<td align="left" valign="top" >
384
 
<code>dyn_handler&nbsp;: <code class="type"><a href="Nethttpd_types.extended_environment.html">Nethttpd_types.extended_environment</a> -><br>       (#<a href="Netcgi1_compat.Netcgi_types.cgi_activation.html">Netcgi1_compat.Netcgi_types.cgi_activation</a> as 'a) -> unit</code>;</code></td>
 
469
<code>dyn_handler&nbsp;: <code class="type"><a href="Nethttpd_types.extended_environment-c.html">Nethttpd_types.extended_environment</a> -> (#<a href="Netcgi.cgi_activation-c.html">Netcgi.cgi_activation</a> as 'a) -> unit</code>;</code></td>
385
470
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >A dynamic service is carried out by calling this function with the environment
386
471
 and the CGI activation. The function can use all CGI features, including
387
472
 setting the <code class="code">Location</code> handler to redirect responses.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
390
475
<td align="left" valign="top" >
391
476
<code>&nbsp;&nbsp;</code></td>
392
477
<td align="left" valign="top" >
393
 
<code>dyn_activation&nbsp;: <code class="type"><a href="Nethttpd_types.extended_environment.html">Nethttpd_types.extended_environment</a> -> 'a</code>;</code></td>
 
478
<code>dyn_activation&nbsp;: <code class="type"><a href="Nethttpd_types.extended_environment-c.html">Nethttpd_types.extended_environment</a> -> 'a</code>;</code></td>
394
479
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The way the <code class="code">Netcgi_types.cgi_activation</code> is created. Look below
395
480
 for <code class="code">std_activation</code>.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
396
481
</tr>
428
513
}
429
514
 
430
515
 
431
 
<pre><span class="keyword">val</span> <a name="VALstd_activation"></a>std_activation : <code class="type"><a href="Nethttpd_services.html#TYPEstd_activation">std_activation</a> -><br>       <a href="Nethttpd_types.extended_environment.html">Nethttpd_types.extended_environment</a> -><br>       <a href="Netcgi1_compat.Netcgi_types.cgi_activation.html">Netcgi1_compat.Netcgi_types.cgi_activation</a></code></pre><div class="info">
 
516
<pre><span id="VALstd_activation"><span class="keyword">val</span> std_activation</span> : <code class="type"><a href="Nethttpd_services.html#TYPEstd_activation">std_activation</a> -><br>       <a href="Nethttpd_types.extended_environment-c.html">Nethttpd_types.extended_environment</a> -> <a href="Netcgi.cgi_activation-c.html">Netcgi.cgi_activation</a></code></pre><div class="info">
432
517
Create the function for <code class="code">dyn_activation</code> from a <code class="code">std_activation</code> tag.
433
518
 Example:
434
519
 <code class="code"> let dyn_actv = std_activation `Std_activation_unbuffered </code><br>
435
520
</div>
436
 
<pre><span class="keyword">val</span> <a name="VALdynamic_service"></a>dynamic_service : <code class="type">(#<a href="Netcgi1_compat.Netcgi_types.cgi_activation.html">Netcgi1_compat.Netcgi_types.cgi_activation</a> as 'a)<br>       <a href="Nethttpd_services.html#TYPEdynamic_service">dynamic_service</a> -><br>       [> `Dynamic_service of 'a <a href="Nethttpd_services.html#TYPEdynamic_service">dynamic_service</a> ]<br>       <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
521
<pre><span id="VALdynamic_service"><span class="keyword">val</span> dynamic_service</span> : <code class="type">(#<a href="Netcgi.cgi_activation-c.html">Netcgi.cgi_activation</a> as 'a) <a href="Nethttpd_services.html#TYPEdynamic_service">dynamic_service</a> -><br>       [> `Dynamic_service of 'a <a href="Nethttpd_services.html#TYPEdynamic_service">dynamic_service</a> ]<br>       <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
437
522
Configures the dynamic service.<br>
438
523
</div>
439
 
<pre><span class="keyword">type</span> <a name="TYPEac_by_host_rule"></a><code class="type"></code>ac_by_host_rule = <code class="type">[ `Allow of string list | `Deny of string list ]</code> </pre>
 
524
<pre><span id="TYPEac_by_host_rule"><span class="keyword">type</span> <code class="type"></code>ac_by_host_rule</span> = <code class="type">[ `Allow of string list | `Deny of string list ]</code> </pre>
440
525
<div class="info">
441
526
Access control by host: <ul>
442
527
<li><code class="code">`Allow</code>: Only the listed hosts are allowed; all other are denied</li>
445
530
<br>
446
531
</div>
447
532
 
448
 
<pre><span class="keyword">type</span> <a name="TYPEac_by_host"></a><code class="type">'a</code> ac_by_host = <code class="type"><a href="Nethttpd_services.html#TYPEac_by_host_rule">ac_by_host_rule</a> * 'a <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code> </pre>
 
533
<pre><span id="TYPEac_by_host"><span class="keyword">type</span> <code class="type">'a</code> ac_by_host</span> = <code class="type"><a href="Nethttpd_services.html#TYPEac_by_host_rule">ac_by_host_rule</a> * 'a <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code> </pre>
449
534
<div class="info">
450
535
The service is protected by the access control rule<br>
451
536
</div>
452
537
 
453
 
<pre><span class="keyword">val</span> <a name="VALac_by_host"></a>ac_by_host : <code class="type">'a <a href="Nethttpd_services.html#TYPEac_by_host">ac_by_host</a> -><br>       [> `Ac_by_host of 'a <a href="Nethttpd_services.html#TYPEac_by_host">ac_by_host</a> ]<br>       <a href="Nethttpd_types.http_service.html">Nethttpd_types.http_service</a></code></pre><div class="info">
 
538
<pre><span id="VALac_by_host"><span class="keyword">val</span> ac_by_host</span> : <code class="type">'a <a href="Nethttpd_services.html#TYPEac_by_host">ac_by_host</a> -><br>       [> `Ac_by_host of 'a <a href="Nethttpd_services.html#TYPEac_by_host">ac_by_host</a> ]<br>       <a href="Nethttpd_types.http_service-c.html">Nethttpd_types.http_service</a></code></pre><div class="info">
454
539
Configures host-based access control<br>
455
540
</div>
456
 
<pre><span class="keyword">val</span> <a name="VALread_media_types_file"></a>read_media_types_file : <code class="type">string -> (string * string) list</code></pre><div class="info">
 
541
<pre><span id="VALread_media_types_file"><span class="keyword">val</span> read_media_types_file</span> : <code class="type">string -> (string * string) list</code></pre><div class="info">
457
542
Reads a text file with two columns where the left column is the
458
543
 media type and the right column the corresponding suffix.
459
544
 Returns the contents as pairs <code class="code"> (suffix, type) </code>.<br>
460
545
</div>
461
 
</body></html>
 
 
b'\\ No newline at end of file'
 
546
<pre><span class="keyword">module</span> <a href="Nethttpd_services.Debug.html">Debug</a>: <code class="code">sig</code> <a href="Nethttpd_services.Debug.html">..</a> <code class="code">end</code></pre></body></html>
 
 
b'\\ No newline at end of file'