mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-10 04:35:46 -04:00
13 lines
7.2 KiB
HTML
13 lines
7.2 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make_proxy (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_proxy)</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_cache</a> » Make_proxy</nav><header class="odoc-preamble"><h1>Module <code><span>Connection_cache.Make_proxy</span></code></h1><p>This functor keeps a cache of connections for reuse. Connections are reused based on their remote <code>Conduit.endp</code> (effectively IP / port). It also supports automatically connecting and reconnecting to direct and tunneling proxies, based on the remote URI scheme (HTTP will select direct proxies, HTTPS tunneling proxies).</p></header><div class="odoc-tocs"><nav class="odoc-toc odoc-local-toc"><ul><li><a href="#parameters">Parameters</a></li><li><a href="#signature">Signature</a></li></ul></nav></div><div class="odoc-content"><h2 id="parameters"><a href="#parameters" class="anchor"></a>Parameters</h2><div class="odoc-spec"><div class="spec parameter anchored" id="argument-1-Connection"><a href="#argument-1-Connection" class="anchor"></a><code><span><span class="keyword">module</span> </span><span><a href="argument-1-Connection/index.html">Connection</a></span><span> : <a href="../../S/module-type-Connection/index.html">S.Connection</a></span></code></div></div><div class="odoc-spec"><div class="spec parameter anchored" id="argument-2-Sleep"><a href="#argument-2-Sleep" class="anchor"></a><code><span><span class="keyword">module</span> </span><span><a href="argument-2-Sleep/index.html">Sleep</a></span><span> : <a href="../../S/module-type-Sleep/index.html">S.Sleep</a></span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <a href="../../S/module-type-Connection_cache/index.html">S.Connection_cache</a></span></code></summary><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-call"><a href="#val-call" class="anchor"></a><code><span><span class="keyword">val</span> call : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="../../S/index.html#type-call">S.call</a></span></code></div><div class="spec-doc"><p>Process a request. Please see <code>call</code>.</p></div></div></details></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create :
|
||
<span><span class="optlabel">?ctx</span>:<a href="argument-1-Connection/Net/index.html#type-ctx">Connection.Net.ctx</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?keep</span>:int64 <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?retry</span>:int <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?parallel</span>:int <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?depth</span>:int <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?scheme_proxy</span>:<span><span>(string * <a href="../../../../uri/Uri/index.html#type-t">Uri.t</a>)</span> list</span> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?all_proxy</span>:<a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?no_proxy</span>:string <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?proxy_headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span>
|
||
<span>unit <span class="arrow">-></span></span>
|
||
<a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Create a new connection cache. The outer connections to the proxy and the inner connections share the same parameters.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">ctx</span> <p>Conduit context to use. See <a href="argument-1-Connection/Net/index.html#type-ctx"><code>Connection.Net.ctx</code></a>.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">keep</span> <p>Number of nanoseconds to keep an idle connection around.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">retry</span> <p>Number of times a <em>gracefully</em> failed request is automatically retried. <em>graceful</em> means failed with <a href="argument-1-Connection/index.html#exception-Retry"><code>Connection.Retry</code></a>. Requests with a <code>`Stream</code> <a href="../../Body/index.html"><code>Body</code></a> cannot be retried automatically. Such requests will fail with <a href="argument-1-Connection/index.html#exception-Retry"><code>Connection.Retry</code></a> and a new <a href="../../Body/index.html"><code>Body</code></a> will need to be provided to retry.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">parallel</span> <p>maximum number of connections to establish to a single endpoint. Beware: A single hostname may resolve to multiple endpoints. In such a case connections may be created in excess to what was intended.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">depth</span> <p>maximum number of requests to queue and / or send on a single connection.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">scheme_proxy</span> <p>The proxy URI associated to each (remote) scheme.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">all_proxy</span> <p>The default proxy to use. Proxy for specific schemes have precedence over this.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">no_proxy</span> <p>Disable proxies for specific hosts, specified as curl's <code>NO_PROXY</code>.</p></li></ul><ul class="at-tags"><li class="see"><span class="at-tag">see</span> <a href="https://everything.curl.dev/usingcurl/proxies/env.html#no-proxy" class="value">https://everything.curl.dev/usingcurl/proxies/env.html#no-proxy</a> </li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">proxy_headers</span> <p>Headers to pass to the proxy.</p></li></ul></div></div></div></body></html>
|