1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Nethttpd_engine.html">
<link rel="next" href="Nethttpd_plex.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Uq_gtk" rel="Chapter" href="Uq_gtk.html">
<link title="Equeue" rel="Chapter" href="Equeue.html">
<link title="Unixqueue" rel="Chapter" href="Unixqueue.html">
<link title="Uq_engines" rel="Chapter" href="Uq_engines.html">
<link title="Uq_socks5" rel="Chapter" href="Uq_socks5.html">
<link title="Unixqueue_mt" rel="Chapter" href="Unixqueue_mt.html">
<link title="Equeue_intro" rel="Chapter" href="Equeue_intro.html">
<link title="Uq_ssl" rel="Chapter" href="Uq_ssl.html">
<link title="Uq_tcl" rel="Chapter" href="Uq_tcl.html">
<link title="Netcgi_common" rel="Chapter" href="Netcgi_common.html">
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
<link title="Netcgi_ajp" rel="Chapter" href="Netcgi_ajp.html">
<link title="Netcgi_scgi" rel="Chapter" href="Netcgi_scgi.html">
<link title="Netcgi_cgi" rel="Chapter" href="Netcgi_cgi.html">
<link title="Netcgi_fcgi" rel="Chapter" href="Netcgi_fcgi.html">
<link title="Netcgi_dbi" rel="Chapter" href="Netcgi_dbi.html">
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html">
<link title="Netcgi_test" rel="Chapter" href="Netcgi_test.html">
<link title="Netcgi_porting" rel="Chapter" href="Netcgi_porting.html">
<link title="Netcgi_plex" rel="Chapter" href="Netcgi_plex.html">
<link title="Http_client" rel="Chapter" href="Http_client.html">
<link title="Telnet_client" rel="Chapter" href="Telnet_client.html">
<link title="Ftp_data_endpoint" rel="Chapter" href="Ftp_data_endpoint.html">
<link title="Ftp_client" rel="Chapter" href="Ftp_client.html">
<link title="Nethttpd_types" rel="Chapter" href="Nethttpd_types.html">
<link title="Nethttpd_kernel" rel="Chapter" href="Nethttpd_kernel.html">
<link title="Nethttpd_reactor" rel="Chapter" href="Nethttpd_reactor.html">
<link title="Nethttpd_engine" rel="Chapter" href="Nethttpd_engine.html">
<link title="Nethttpd_services" rel="Chapter" href="Nethttpd_services.html">
<link title="Nethttpd_plex" rel="Chapter" href="Nethttpd_plex.html">
<link title="Nethttpd_intro" rel="Chapter" href="Nethttpd_intro.html">
<link title="Netplex_types" rel="Chapter" href="Netplex_types.html">
<link title="Netplex_mp" rel="Chapter" href="Netplex_mp.html">
<link title="Netplex_mt" rel="Chapter" href="Netplex_mt.html">
<link title="Netplex_log" rel="Chapter" href="Netplex_log.html">
<link title="Netplex_controller" rel="Chapter" href="Netplex_controller.html">
<link title="Netplex_container" rel="Chapter" href="Netplex_container.html">
<link title="Netplex_sockserv" rel="Chapter" href="Netplex_sockserv.html">
<link title="Netplex_workload" rel="Chapter" href="Netplex_workload.html">
<link title="Netplex_main" rel="Chapter" href="Netplex_main.html">
<link title="Netplex_config" rel="Chapter" href="Netplex_config.html">
<link title="Netplex_kit" rel="Chapter" href="Netplex_kit.html">
<link title="Rpc_netplex" rel="Chapter" href="Rpc_netplex.html">
<link title="Netplex_cenv" rel="Chapter" href="Netplex_cenv.html">
<link title="Netplex_intro" rel="Chapter" href="Netplex_intro.html">
<link title="Netshm" rel="Chapter" href="Netshm.html">
<link title="Netshm_data" rel="Chapter" href="Netshm_data.html">
<link title="Netshm_hashtbl" rel="Chapter" href="Netshm_hashtbl.html">
<link title="Netshm_array" rel="Chapter" href="Netshm_array.html">
<link title="Netshm_intro" rel="Chapter" href="Netshm_intro.html">
<link title="Netconversion" rel="Chapter" href="Netconversion.html">
<link title="Netchannels" rel="Chapter" href="Netchannels.html">
<link title="Netstream" rel="Chapter" href="Netstream.html">
<link title="Mimestring" rel="Chapter" href="Mimestring.html">
<link title="Netmime" rel="Chapter" href="Netmime.html">
<link title="Netsendmail" rel="Chapter" href="Netsendmail.html">
<link title="Neturl" rel="Chapter" href="Neturl.html">
<link title="Netaddress" rel="Chapter" href="Netaddress.html">
<link title="Netbuffer" rel="Chapter" href="Netbuffer.html">
<link title="Netdate" rel="Chapter" href="Netdate.html">
<link title="Netencoding" rel="Chapter" href="Netencoding.html">
<link title="Netulex" rel="Chapter" href="Netulex.html">
<link title="Netaccel" rel="Chapter" href="Netaccel.html">
<link title="Netaccel_link" rel="Chapter" href="Netaccel_link.html">
<link title="Nethtml" rel="Chapter" href="Nethtml.html">
<link title="Netstring_str" rel="Chapter" href="Netstring_str.html">
<link title="Netstring_pcre" rel="Chapter" href="Netstring_pcre.html">
<link title="Netstring_mt" rel="Chapter" href="Netstring_mt.html">
<link title="Netmappings" rel="Chapter" href="Netmappings.html">
<link title="Netaux" rel="Chapter" href="Netaux.html">
<link title="Nethttp" rel="Chapter" href="Nethttp.html">
<link title="Netchannels_tut" rel="Chapter" href="Netchannels_tut.html">
<link title="Netmime_tut" rel="Chapter" href="Netmime_tut.html">
<link title="Netsendmail_tut" rel="Chapter" href="Netsendmail_tut.html">
<link title="Netulex_tut" rel="Chapter" href="Netulex_tut.html">
<link title="Neturl_tut" rel="Chapter" href="Neturl_tut.html">
<link title="Netsys" rel="Chapter" href="Netsys.html">
<link title="Netpop" rel="Chapter" href="Netpop.html">
<link title="Rpc_auth_dh" rel="Chapter" href="Rpc_auth_dh.html">
<link title="Rpc_key_service" rel="Chapter" href="Rpc_key_service.html">
<link title="Rpc_time" rel="Chapter" href="Rpc_time.html">
<link title="Rpc_auth_local" rel="Chapter" href="Rpc_auth_local.html">
<link title="Rtypes" rel="Chapter" href="Rtypes.html">
<link title="Xdr" rel="Chapter" href="Xdr.html">
<link title="Rpc" rel="Chapter" href="Rpc.html">
<link title="Rpc_program" rel="Chapter" href="Rpc_program.html">
<link title="Rpc_portmapper_aux" rel="Chapter" href="Rpc_portmapper_aux.html">
<link title="Rpc_packer" rel="Chapter" href="Rpc_packer.html">
<link title="Rpc_transport" rel="Chapter" href="Rpc_transport.html">
<link title="Rpc_client" rel="Chapter" href="Rpc_client.html">
<link title="Rpc_simple_client" rel="Chapter" href="Rpc_simple_client.html">
<link title="Rpc_portmapper_clnt" rel="Chapter" href="Rpc_portmapper_clnt.html">
<link title="Rpc_portmapper" rel="Chapter" href="Rpc_portmapper.html">
<link title="Rpc_server" rel="Chapter" href="Rpc_server.html">
<link title="Rpc_auth_sys" rel="Chapter" href="Rpc_auth_sys.html">
<link title="Rpc_intro" rel="Chapter" href="Rpc_intro.html">
<link title="Rpc_mapping_ref" rel="Chapter" href="Rpc_mapping_ref.html">
<link title="Rpc_ssl" rel="Chapter" href="Rpc_ssl.html">
<link title="Rpc_xti_client" rel="Chapter" href="Rpc_xti_client.html">
<link title="Shell_sys" rel="Chapter" href="Shell_sys.html">
<link title="Shell" rel="Chapter" href="Shell.html">
<link title="Shell_uq" rel="Chapter" href="Shell_uq.html">
<link title="Shell_mt" rel="Chapter" href="Shell_mt.html">
<link title="Shell_intro" rel="Chapter" href="Shell_intro.html">
<link title="Netsmtp" rel="Chapter" href="Netsmtp.html"><title>Ocamlnet 2 Reference Manual : Nethttpd_services</title>
</head>
<body>
<div class="navbar"><a href="Nethttpd_engine.html">Previous</a>
<a href="index.html">Up</a>
<a href="Nethttpd_plex.html">Next</a>
</div>
<center><h1>Module <a href="type_Nethttpd_services.html">Nethttpd_services</a></h1></center>
<br>
<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>
<h1>Service Providers for HTTP daemon</h1>
<p>
This module defines the basic service providers that handle requests and
generate responses. The service providers can be used with both the
reactive and the event-based daemon encapsulations.<br>
<hr width="100%">
<br><code><span class="keyword">type</span> <a name="TYPEhost"></a><code class="type"></code>host = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>server_pref_name : <code class="type">string option</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The preferred name of the host. This can be a DNS name or an IP address.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>server_pref_port : <code class="type">int option</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The preferred port of the host</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>server_names : <code class="type">(string * int) list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Names and ports that match this host definition, for
name-based virtual hosting. The name <code class="code">"*"</code> matches any name, and the port
0 matches any port.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>server_addresses : <code class="type">(Unix.inet_addr * int) list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >IP addresses and ports that also match this host definition, for
IP-based virtual hosting. The address <code class="code">Unix.inet_addr_any</code> matches any
address, and the port 0 matches any port.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}
<div class="info">
For name- and IP-based virtual hosting this record describes the individual
host. An incoming request matches this host if:<ul>
<li>The <code class="code">Host</code> header is mentioned in <code class="code">server_names</code>, or if</li>
<li>The request has been accepted on the port contained in <code class="code">server_addresses</code></li>
</ul>
If <code class="code">server_pref_name</code> is set, the name of the host is set to this string for
further processing (esp. <code class="code">cgi_server_name</code>). If not set, the name of the
host is set to the name corresponding to the matching entry of <code class="code">server_names</code>
or <code class="code">server_addresses</code>, or if this does not succeed, to the real IP address.
<p>
If <code class="code">server_pref_port</code> is set, the port of the host is set to this string for
further processing (esp. <code class="code">cgi_server_port</code>). If not set, the port of the
host is set to the port corresponding to the matching entry of <code class="code">server_names</code>
or <code class="code">server_addresses</code>, or if this does not succeed, to the real port number.<br>
</div>
<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>
<div class="info">
Describes virtual hosting by pairs <code class="code">(host,service)</code>: If <code class="code">host</code> matches the
incoming request, the corresponding <code class="code">service</code> is performed to generate the
response.<br>
</div>
<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">
Configures virtual hosting<br>
</div>
<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">
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>
can be used to specify preferred names.<br>
</div>
<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">
This service responds to "OPTIONS *" requests, and nothing else<br>
</div>
<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>
<div class="info">
Describes that services are bound to URI prefixes. The strings are URI paths
(without URI escaping).
For an incoming request URI, the longest matching prefix is selected, and
the corresponding service is carried out.
<p>
If the URI path in the list ends with a slash, it can only be selected if the
incoming request URI also includes the slash.
<p>
If the URI path in the list does not end with a slash, it can only be selected
if the incoming request URI is exactly identical, or continues the path with
a slash.<br>
</div>
<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">
Configures URI distribution. The incoming request URI is normalized before
being matched, and the request is rewritten to the normalized URI.
<p>
Normalization includes:<ul>
<li>Removal of <code class="code">.</code> path components</li>
<li>Resolution of <code class="code">..</code> path components</li>
</ul>
If the path starts with <code class="code">..</code> after normalization, the request is rejected.<br>
</div>
<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>
<div class="info">
Services are selected by calling the selector function. The first service
for which the function returns <code class="code">true</code> is selected.<br>
</div>
<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">
Configures linear distribution<br>
</div>
<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>
<div class="info">
The request is only accepted if listed (for <code class="code">`Limit</code>), or if not listed
(for <code class="code">`Limit_except</code>).<br>
</div>
<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>
<div class="info">
The first service is selected for which the method filter accepts the request<br>
</div>
<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">
Configures method distribution<br>
</div>
<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>
<div class="info">
Add-on features for file services:<ul>
<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>
compression. When there is <b>both</b> the base file and the gzip file ending in
<code class="code">.gz</code>, accesses to the base file (!) are transmitted with <code class="code">gzip</code>
compression.</li>
<li><code class="code">`Enable_index_file</code>: If enabled, accesses to directories are redirected
to index files. The possible file names are given in the string list.
E.g. <code class="code">`Enable_index_file ["index.html"; "index.htm"]</code>. It is redirected to
these files, so these can be handled by different services if neccessary.</li>
<li><code class="code">`Enable_listings</code>: If enabled, directory listings are generated by calling
the argument function. The <code class="code">PATH_TRANSLATED</code> property of the environment
contains the absolute name of the directory to list. The <code class="code">PATH_INFO</code> property
is the corresponding URI path. <code class="code">SCRIPT_NAME</code> is meaningless.</li>
</ul>
<br>
</div>
<br><code><span class="keyword">type</span> <a name="TYPEfile_service"></a><code class="type"></code>file_service = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>file_docroot : <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The document root for this file service</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>file_uri : <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The URI prefix corresponding to the document root. Escapes are not allowed</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>file_suffix_types : <code class="type">(string * string) list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Maps the file suffixes (after the dot) to media types</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>file_default_type : <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The media type to use if suffix mapping fails</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>file_options : <code class="type"><a href="Nethttpd_services.html#TYPEfile_option">file_option</a> list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Further options for files</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}
<div class="info">
Describes a file service<br>
</div>
<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">
Configures a file service<br>
</div>
<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">
Translates an URI path to a file name. Raises <code class="code">Not_found</code> if not possible.<br>
</div>
<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">
Simple listing generator for <code class="code">`Enable_listings</code>
<p>
<code class="code">hide</code>: An optional list of PCRE regular expressions. File names matching one
of the regexps are hidden in the listing. Defaults to hiding files starting with
a dot, and files ending in a tilde character.<br>
</div>
<br><code><span class="keyword">type</span> <a name="TYPEstd_activation_options"></a><code class="type"></code>std_activation_options = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>stdactv_processing : <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>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>stdactv_operating_type : <code class="type"><a href="Netcgi1_compat.Netcgi.html#TYPEoperating_type">Netcgi1_compat.Netcgi.operating_type</a> option</code>;</code></td>
</tr></table>
}
<div class="info">
These are options for <code class="code">`Std_activation</code>. For explanations, see the <code class="code">Netcgi</code>
module.<br>
</div>
<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>
<div class="info">
The way the <code class="code">Netcgi_types.cgi_activation</code> object is created. For typical
usage, just take:<ul>
<li><code class="code">`Std_activation_unbuffered</code>: Creates a <code class="code">Netcgi.std_activation</code> without
output buffer (type <code class="code">`Direct ""</code>) and memory-based argument processing</li>
<li><code class="code">`Std_activation_buffered</code>: Creates a <code class="code">Netcgi.std_activation</code>
with a transactions buffer in memory, and memory-based argument processing</li>
<li><code class="code">`Std_activation_tempfile</code>: Creates a <code class="code">Netcgi.std_activation</code>
with a file as transactions buffer, and memory-based argument processing</li>
</ul>
The following option is provided for detailed control:<ul>
<li><code class="code">`Std_activation opt</code>: Creates a <code class="code">Netcgi.std_activation</code> with the given
options</li>
</ul>
<br>
</div>
<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">
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>dyn_handler : <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>
<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
and the CGI activation. The function can use all CGI features, including
setting the <code class="code">Location</code> handler to redirect responses.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>dyn_activation : <code class="type"><a href="Nethttpd_types.extended_environment.html">Nethttpd_types.extended_environment</a> -> 'a</code>;</code></td>
<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
for <code class="code">std_activation</code>.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>dyn_uri : <code class="type">string option</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The URI prefix corresponding to this service. This is only used to
compute <code class="code">cgi_path</code>. Leave it to <code class="code">None</code> if not needed.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>dyn_translator : <code class="type">string -> string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The function computing <code class="code">cgi_path_translated</code> from <code class="code">cgi_path</code>. Set it
to <code class="code">(fun _ -> "")</code> if not needed.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code>dyn_accept_all_conditionals : <code class="type">bool</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether to pass requests with <code class="code">If-Match</code> and <code class="code">If-Unmodified-Since</code> headers
to this service. If set to <code class="code">true</code>, the service can optimize the caching
behaviour by interpreting these fields. It is even obliged to interpret
them. If <code class="code">false</code>, requests containing these headers are rejected.
<p>
The other condition fields <code class="code">If-None-Match</code>, <code class="code">If-Modified-Since</code>, and
<code class="code">If-Ranges</code> are not affected by this option. One can safely ignore these
headers.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}
<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">
Create the function for <code class="code">dyn_activation</code> from a <code class="code">std_activation</code> tag.
Example:
<code class="code"> let dyn_actv = std_activation `Std_activation_unbuffered </code><br>
</div>
<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">
Configures the dynamic service.<br>
</div>
<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>
<div class="info">
Access control by host: <ul>
<li><code class="code">`Allow</code>: Only the listed hosts are allowed; all other are denied</li>
<li><code class="code">`Deny</code>: The listed hosts are denied; all other are allowed</li>
</ul>
<br>
</div>
<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>
<div class="info">
The service is protected by the access control rule<br>
</div>
<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">
Configures host-based access control<br>
</div>
<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">
Reads a text file with two columns where the left column is the
media type and the right column the corresponding suffix.
Returns the contents as pairs <code class="code"> (suffix, type) </code>.<br>
</div>
</body></html>
|