mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-05 19:00:32 -05:00
deploy: 217defecc5
This commit is contained in:
parent
9dad54a0e4
commit
1077769f53
2 changed files with 0 additions and 2 deletions
|
|
@ -97,7 +97,6 @@ echo:
|
|||
<span><span class="type-var">'a</span> <span class="arrow">-></span></span>
|
||||
unit</span></code></div><div class="spec-doc"><p>Add a handler on an endpoint, that serves server-sent events.</p><p>The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always <code>GET</code>. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See <a href="#type-server_sent_generator"><code>server_sent_generator</code></a> for more details.</p><p>This handler stays on the original thread (it is synchronous).</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.9</li></ul></div></div><h5 id="upgrade-handlers"><a href="#upgrade-handlers" class="anchor"></a>Upgrade handlers</h5><p>These handlers upgrade the connection to another protocol.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-UPGRADE_HANDLER"><a href="#module-type-UPGRADE_HANDLER" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> UPGRADE_HANDLER</span><span> = <a href="../Tiny_httpd_server/module-type-UPGRADE_HANDLER/index.html">Tiny_httpd_server.UPGRADE_HANDLER</a></span></code></div><div class="spec-doc"><p>Handler that upgrades to another protocol.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-upgrade_handler"><a href="#type-upgrade_handler" class="anchor"></a><code><span><span class="keyword">type</span> upgrade_handler</span><span> = <span>(<span class="keyword">module</span> <a href="module-type-UPGRADE_HANDLER/index.html">UPGRADE_HANDLER</a>)</span></span></code></div><div class="spec-doc"><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_upgrade_handler"><a href="#val-add_upgrade_handler" class="anchor"></a><code><span><span class="keyword">val</span> add_upgrade_handler :
|
||||
<span><span class="optlabel">?accept</span>:<span>(<span><span>unit <a href="../Tiny_httpd_server/Request/index.html#type-t">Request.t</a></span> <span class="arrow">-></span></span> <span><span>(unit, <a href="../Tiny_httpd_server/Response_code/index.html#type-t">Response_code.t</a> * string)</span> <a href="../../ocaml/Stdlib/index.html#type-result">result</a></span>)</span> <span class="arrow">-></span></span>
|
||||
<span><span class="optlabel">?middlewares</span>:<span><a href="../Tiny_httpd_server/Middleware/index.html#type-t">Middleware.t</a> list</span> <span class="arrow">-></span></span>
|
||||
<span><a href="#type-t">t</a> <span class="arrow">-></span></span>
|
||||
<span><span><span>(<span class="type-var">'a</span>, <a href="#type-upgrade_handler">upgrade_handler</a>)</span> <a href="../Tiny_httpd_server/Route/index.html#type-t">Route.t</a></span> <span class="arrow">-></span></span>
|
||||
<span><span class="type-var">'a</span> <span class="arrow">-></span></span>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@
|
|||
<span><span class="type-var">'a</span> <span class="arrow">-></span></span>
|
||||
unit</span></code></div><div class="spec-doc"><p>Add a handler on an endpoint, that serves server-sent events.</p><p>The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always <code>GET</code>. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See <a href="#type-server_sent_generator"><code>server_sent_generator</code></a> for more details.</p><p>This handler stays on the original thread (it is synchronous).</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.9</li></ul></div></div><h3 id="upgrade-handlers"><a href="#upgrade-handlers" class="anchor"></a>Upgrade handlers</h3><p>These handlers upgrade the connection to another protocol.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-UPGRADE_HANDLER"><a href="#module-type-UPGRADE_HANDLER" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-UPGRADE_HANDLER/index.html">UPGRADE_HANDLER</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Handler that upgrades to another protocol.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-upgrade_handler"><a href="#type-upgrade_handler" class="anchor"></a><code><span><span class="keyword">type</span> upgrade_handler</span><span> = <span>(<span class="keyword">module</span> <a href="module-type-UPGRADE_HANDLER/index.html">UPGRADE_HANDLER</a>)</span></span></code></div><div class="spec-doc"><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_upgrade_handler"><a href="#val-add_upgrade_handler" class="anchor"></a><code><span><span class="keyword">val</span> add_upgrade_handler :
|
||||
<span><span class="optlabel">?accept</span>:<span>(<span><span>unit <a href="Request/index.html#type-t">Request.t</a></span> <span class="arrow">-></span></span> <span><span>(unit, <a href="Response_code/index.html#type-t">Response_code.t</a> * string)</span> <a href="../../ocaml/Stdlib/index.html#type-result">result</a></span>)</span> <span class="arrow">-></span></span>
|
||||
<span><span class="optlabel">?middlewares</span>:<span><a href="Middleware/index.html#type-t">Middleware.t</a> list</span> <span class="arrow">-></span></span>
|
||||
<span><a href="#type-t">t</a> <span class="arrow">-></span></span>
|
||||
<span><span><span>(<span class="type-var">'a</span>, <a href="#type-upgrade_handler">upgrade_handler</a>)</span> <a href="Route/index.html#type-t">Route.t</a></span> <span class="arrow">-></span></span>
|
||||
<span><span class="type-var">'a</span> <span class="arrow">-></span></span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue