mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-10 12:45:45 -04:00
2 lines
8.1 KiB
HTML
2 lines
8.1 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Net (cohttp-lwt.Cohttp_lwt.Connection.Make.Net)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../../../index.html">Index</a> » <a href="../../../../index.html">cohttp-lwt</a> » <a href="../../../index.html">Cohttp_lwt</a> » <a href="../../index.html">Connection</a> » <a href="../index.html">Make</a> » Net</nav><header class="odoc-preamble"><h1>Parameter <code><span>Make.Net</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-IO"><a href="#module-IO" class="anchor"></a><code><span><span class="keyword">module</span> <a href="IO/index.html">IO</a></span><span> : <a href="../../../S/module-type-IO/index.html">S.IO</a></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-client"><a href="#type-client" class="anchor"></a><code><span><span class="keyword">type</span> client</span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-endp"><a href="#type-endp" class="anchor"></a><code><span><span class="keyword">type</span> endp</span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-ctx"><a href="#type-ctx" class="anchor"></a><code><span><span class="keyword">type</span> ctx</span></code></div><div class="spec-doc"><p>Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.</p><p>Depending on <code>ctx</code>, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, <code>ctx</code> might initiate a secured connection with TLS (using <code>ocaml-tls</code>) or SSL (using <code>ocaml-ssl</code>), on <code>*:443</code> or on the specified port by the user. If neitehr <code>ocaml-tls</code> or <code>ocaml-ssl</code> are installed on the system, <code>cohttp</code>/<code>conduit</code> tries the usual (<code>*:80</code>) or the specified port by the user in a non-secured way.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sexp_of_ctx"><a href="#val-sexp_of_ctx" class="anchor"></a><code><span><span class="keyword">val</span> sexp_of_ctx : <span><a href="#type-ctx">ctx</a> <span class="arrow">-></span></span> <a href="../../../../../sexplib0/Sexplib0/Sexp/index.html#type-t">Sexplib0.Sexp.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-default_ctx"><a href="#val-default_ctx" class="anchor"></a><code><span><span class="keyword">val</span> default_ctx : <span><a href="#type-ctx">ctx</a> <a href="../../../../../ocaml/Stdlib/Lazy/index.html#type-t">Stdlib.Lazy.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-resolve"><a href="#val-resolve" class="anchor"></a><code><span><span class="keyword">val</span> resolve : <span><span class="label">ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span> <span><a href="../../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span> <span><a href="#type-endp">endp</a> <a href="IO/index.html#type-t">IO.t</a></span></span></code></div><div class="spec-doc"><p><code>resolve ~ctx uri</code> resolves <code>uri</code> into an endpoint description. This is <code>Resolver_lwt.resolve_uri ~uri ctx.resolver</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tunnel"><a href="#val-tunnel" class="anchor"></a><code><span><span class="keyword">val</span> tunnel : <span>string <span class="arrow">-></span></span> <span><span>(<a href="IO/index.html#type-ic">IO.ic</a> * <a href="IO/index.html#type-oc">IO.oc</a>)</span> <span class="arrow">-></span></span> <a href="#type-client">client</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-connect_uri"><a href="#val-connect_uri" class="anchor"></a><code><span><span class="keyword">val</span> connect_uri : <span><span class="label">ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span> <span><a href="../../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span> <span><span>(<a href="IO/index.html#type-conn">IO.conn</a> * <a href="IO/index.html#type-ic">IO.ic</a> * <a href="IO/index.html#type-oc">IO.oc</a>)</span> <a href="IO/index.html#type-t">IO.t</a></span></span></code></div><div class="spec-doc"><p><code>connect_uri ~ctx uri</code> starts a <i>flow</i> on the given <code>uri</code>. The choice of the protocol (with or without encryption) is done by the <i>scheme</i> of the given <code>uri</code>:</p><ul><li>If the scheme is <code>https</code>, we will <b>extend</b> <code>ctx</code> to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.</li><li>If the scheme is <code>http</code>, we will <b>extend</b> <code>ctx</code> to be able to start a simple TCP/IP connection on the default or user-specified port.</li></ul><p>These extensions have the highest priority (<code>Conduit</code> will try to initiate a communication with them first). By <i>extension</i>, we mean that the user is able to fill its own <code>ctx</code> and we don't overlap resolution functions from the given <code>ctx</code>.</p><p>This is <code>resolve ~ctx uri >>= connect_endp ~ctx</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-connect_endp"><a href="#val-connect_endp" class="anchor"></a><code><span><span class="keyword">val</span> connect_endp : <span><span class="label">ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span> <span><a href="#type-endp">endp</a> <span class="arrow">-></span></span> <span><span>(<a href="IO/index.html#type-conn">IO.conn</a> * <a href="IO/index.html#type-ic">IO.ic</a> * <a href="IO/index.html#type-oc">IO.oc</a>)</span> <a href="IO/index.html#type-t">IO.t</a></span></span></code></div><div class="spec-doc"><p><code>connect_endp ~ctx endp</code> starts a <i>flow</i> to the given <code>endp</code>. <code>endp</code> describes address and protocol of the endpoint to connect to.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-connect_client"><a href="#val-connect_client" class="anchor"></a><code><span><span class="keyword">val</span> connect_client : <span><span class="label">ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span> <span><a href="#type-client">client</a> <span class="arrow">-></span></span> <span><span>(<a href="IO/index.html#type-conn">IO.conn</a> * <a href="IO/index.html#type-ic">IO.ic</a> * <a href="IO/index.html#type-oc">IO.oc</a>)</span> <a href="IO/index.html#type-t">IO.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-close_in"><a href="#val-close_in" class="anchor"></a><code><span><span class="keyword">val</span> close_in : <span><a href="IO/index.html#type-ic">IO.ic</a> <span class="arrow">-></span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-close_out"><a href="#val-close_out" class="anchor"></a><code><span><span class="keyword">val</span> close_out : <span><a href="IO/index.html#type-oc">IO.oc</a> <span class="arrow">-></span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-close"><a href="#val-close" class="anchor"></a><code><span><span class="keyword">val</span> close : <span><a href="IO/index.html#type-ic">IO.ic</a> <span class="arrow">-></span></span> <span><a href="IO/index.html#type-oc">IO.oc</a> <span class="arrow">-></span></span> unit</span></code></div></div></div></body></html>
|