File manager - Edit - /usr/share/doc/varnish/html/reference/vmod_proxy.html
Back
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>VMOD proxy - Varnish Module to extract TLV attributes from PROXYv2 — Varnish version 7.1.1 documentation</title> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/classic.css" type="text/css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="VMOD purge - Varnish Purge Module" href="vmod_purge.html" /> <link rel="prev" title="VMOD directors - Varnish Directors Module" href="vmod_directors.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="vmod_purge.html" title="VMOD purge - Varnish Purge Module" accesskey="N">next</a> |</li> <li class="right" > <a href="vmod_directors.html" title="VMOD directors - Varnish Directors Module" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.1.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Varnish Reference Manual</a> »</li> <li class="nav-item nav-item-this"><a href="">VMOD proxy - Varnish Module to extract TLV attributes from PROXYv2</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="vmod-proxy-varnish-module-to-extract-tlv-attributes-from-proxyv2"> <span id="vmod-proxy-3"></span><h1>VMOD proxy - Varnish Module to extract TLV attributes from PROXYv2<a class="headerlink" href="#vmod-proxy-varnish-module-to-extract-tlv-attributes-from-proxyv2" title="Permalink to this headline">¶</a></h1> <div class="section" id="synopsis"> <h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2> <pre class="literal-block">import proxy [as name] [from "path"] <a class="reference internal" href="#proxy-alpn"><span class="std std-ref">STRING alpn()</span></a> <a class="reference internal" href="#proxy-authority"><span class="std std-ref">STRING authority()</span></a> <a class="reference internal" href="#proxy-is-ssl"><span class="std std-ref">BOOL is_ssl()</span></a> <a class="reference internal" href="#proxy-client-has-cert-sess"><span class="std std-ref">BOOL client_has_cert_sess()</span></a> <a class="reference internal" href="#proxy-client-has-cert-conn"><span class="std std-ref">BOOL client_has_cert_conn()</span></a> <a class="reference internal" href="#proxy-ssl-verify-result"><span class="std std-ref">INT ssl_verify_result()</span></a> <a class="reference internal" href="#proxy-ssl-version"><span class="std std-ref">STRING ssl_version()</span></a> <a class="reference internal" href="#proxy-client-cert-cn"><span class="std std-ref">STRING client_cert_cn()</span></a> <a class="reference internal" href="#proxy-ssl-cipher"><span class="std std-ref">STRING ssl_cipher()</span></a> <a class="reference internal" href="#proxy-cert-sign"><span class="std std-ref">STRING cert_sign()</span></a> <a class="reference internal" href="#proxy-cert-key"><span class="std std-ref">STRING cert_key()</span></a></pre> </div> <div class="section" id="description"> <h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2> <p><em>vmod_proxy</em> contains functions to extract proxy-protocol-v2 TLV attributes as described in <a class="reference external" href="https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt">https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt</a>.</p> <div class="section" id="string-alpn"> <span id="proxy-alpn"></span><h3>STRING alpn()<a class="headerlink" href="#string-alpn" title="Permalink to this headline">¶</a></h3> <p>Extract ALPN attribute.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">alpn</span> <span class="o">=</span> <span class="n">proxy</span><span class="o">.</span><span class="n">alpn</span><span class="p">();</span> </pre></div> </div> </div> <div class="section" id="string-authority"> <span id="proxy-authority"></span><h3>STRING authority()<a class="headerlink" href="#string-authority" title="Permalink to this headline">¶</a></h3> <p>Extract authority attribute. This corresponds to SNI from a TLS connection.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">authority</span> <span class="o">=</span> <span class="n">proxy</span><span class="o">.</span><span class="n">authority</span><span class="p">();</span> </pre></div> </div> </div> <div class="section" id="bool-is-ssl"> <span id="proxy-is-ssl"></span><h3>BOOL is_ssl()<a class="headerlink" href="#bool-is-ssl" title="Permalink to this headline">¶</a></h3> <p>Report if proxy-protocol-v2 has SSL TLV.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">proxy</span><span class="o">.</span><span class="n">is_ssl</span><span class="p">())</span> <span class="p">{</span> <span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">ssl</span><span class="o">-</span><span class="n">version</span> <span class="o">=</span> <span class="n">proxy</span><span class="o">.</span><span class="n">ssl_version</span><span class="p">();</span> <span class="p">}</span> </pre></div> </div> </div> <div class="section" id="bool-client-has-cert-sess"> <span id="proxy-client-has-cert-sess"></span><h3>BOOL client_has_cert_sess()<a class="headerlink" href="#bool-client-has-cert-sess" title="Permalink to this headline">¶</a></h3> <p>Report if the client provided a certificate at least once over the TLS session this connection belongs to.</p> </div> <div class="section" id="bool-client-has-cert-conn"> <span id="proxy-client-has-cert-conn"></span><h3>BOOL client_has_cert_conn()<a class="headerlink" href="#bool-client-has-cert-conn" title="Permalink to this headline">¶</a></h3> <p>Report if the client provided a certificate over the current connection.</p> </div> <div class="section" id="int-ssl-verify-result"> <span id="proxy-ssl-verify-result"></span><h3>INT ssl_verify_result()<a class="headerlink" href="#int-ssl-verify-result" title="Permalink to this headline">¶</a></h3> <p>Report the SSL_get_verify_result from a TLS session. It only matters if client_has_cert_sess() is true. Per default, value is set to 0 (X509_V_OK).</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">proxy</span><span class="o">.</span><span class="n">client_has_cert_sess</span><span class="p">()</span> <span class="o">&&</span> <span class="n">proxy</span><span class="o">.</span><span class="n">ssl_verify_result</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span> <span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">ssl</span><span class="o">-</span><span class="n">verify</span> <span class="o">=</span> <span class="s2">"ok"</span><span class="p">;</span> <span class="p">}</span> </pre></div> </div> </div> <div class="section" id="string-ssl-version"> <span id="proxy-ssl-version"></span><h3>STRING ssl_version()<a class="headerlink" href="#string-ssl-version" title="Permalink to this headline">¶</a></h3> <p>Extract SSL version attribute.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">ssl</span><span class="o">-</span><span class="n">version</span> <span class="o">=</span> <span class="n">proxy</span><span class="o">.</span><span class="n">ssl_version</span><span class="p">();</span> </pre></div> </div> </div> <div class="section" id="string-client-cert-cn"> <span id="proxy-client-cert-cn"></span><h3>STRING client_cert_cn()<a class="headerlink" href="#string-client-cert-cn" title="Permalink to this headline">¶</a></h3> <p>Extract the common name attribute of the client certificate’s.</p> <dl class="simple"> <dt>Example::</dt><dd><p>set req.http.cert-cn = proxy.client_cert_cn();</p> </dd> </dl> </div> <div class="section" id="string-ssl-cipher"> <span id="proxy-ssl-cipher"></span><h3>STRING ssl_cipher()<a class="headerlink" href="#string-ssl-cipher" title="Permalink to this headline">¶</a></h3> <p>Extract the SSL cipher attribute.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">ssl</span><span class="o">-</span><span class="n">cipher</span> <span class="o">=</span> <span class="n">proxy</span><span class="o">.</span><span class="n">ssl_cipher</span><span class="p">();</span> </pre></div> </div> </div> <div class="section" id="string-cert-sign"> <span id="proxy-cert-sign"></span><h3>STRING cert_sign()<a class="headerlink" href="#string-cert-sign" title="Permalink to this headline">¶</a></h3> <p>Extract the certificate signature algorithm attribute.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">cert</span><span class="o">-</span><span class="n">sign</span> <span class="o">=</span> <span class="n">proxy</span><span class="o">.</span><span class="n">cert_sign</span><span class="p">();</span> </pre></div> </div> </div> <div class="section" id="string-cert-key"> <span id="proxy-cert-key"></span><h3>STRING cert_key()<a class="headerlink" href="#string-cert-key" title="Permalink to this headline">¶</a></h3> <p>Extract the certificate key algorithm attribute.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">cert</span><span class="o">-</span><span class="n">key</span> <span class="o">=</span> <span class="n">proxy</span><span class="o">.</span><span class="n">cert_key</span><span class="p">();</span> </pre></div> </div> </div> </div> <div class="section" id="see-also"> <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><p><a class="reference internal" href="varnishd.html#varnishd-1"><span class="std std-ref">varnishd</span></a></p></li> <li><p><a class="reference internal" href="vsl.html#vsl-7"><span class="std std-ref">VSL</span></a></p></li> </ul> </div> <div class="section" id="copyright"> <h2>COPYRIGHT<a class="headerlink" href="#copyright" title="Permalink to this headline">¶</a></h2> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>Copyright (c) 2018 GANDI SAS All rights reserved. Author: Emmanuel Hocdet <manu@gandi.net> SPDX-License-Identifier: BSD-2-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </pre></div> </div> </div> </div> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">VMOD proxy - Varnish Module to extract TLV attributes from PROXYv2</a></li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="vmod_directors.html" title="previous chapter">VMOD directors - Varnish Directors Module</a></p> <h4>Next topic</h4> <p class="topless"><a href="vmod_purge.html" title="next chapter">VMOD purge - Varnish Purge Module</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/reference/vmod_proxy.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="vmod_purge.html" title="VMOD purge - Varnish Purge Module" >next</a> |</li> <li class="right" > <a href="vmod_directors.html" title="VMOD directors - Varnish Directors Module" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.1.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >The Varnish Reference Manual</a> »</li> <li class="nav-item nav-item-this"><a href="">VMOD proxy - Varnish Module to extract TLV attributes from PROXYv2</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2010-2014, Varnish Software AS. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3. </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.2 |
proxy
|
phpinfo
|
Settings