⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.96
Server IP:
147.93.97.220
Server:
Linux srv843233 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
varnish
/
html
/
reference
/
View File Name :
vmod_proxy.html
<!DOCTYPE html> <html lang="en" data-content_root="../"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <title>VMOD proxy - Varnish Module to extract TLV attributes from PROXYv2 — Varnish version 7.5.0 documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" /> <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=e2714048" /> <script src="../_static/documentation_options.js?v=8214db13"></script> <script src="../_static/doctools.js?v=888ff710"></script> <script src="../_static/sphinx_highlight.js?v=dc90522c"></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 h2 - Module to control the built-in HTTP2 transport" href="vmod_h2.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_h2.html" title="VMOD h2 - Module to control the built-in HTTP2 transport" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.5.0 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"> <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="Link to this heading">¶</a></h1> <section id="synopsis"> <h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Link to this heading">¶</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> </section> <section id="description"> <h2>DESCRIPTION<a class="headerlink" href="#description" title="Link to this heading">¶</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> <section id="string-alpn"> <span id="proxy-alpn"></span><h3>STRING alpn()<a class="headerlink" href="#string-alpn" title="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <section id="string-authority"> <span id="proxy-authority"></span><h3>STRING authority()<a class="headerlink" href="#string-authority" title="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <section id="bool-is-ssl"> <span id="proxy-is-ssl"></span><h3>BOOL is_ssl()<a class="headerlink" href="#bool-is-ssl" title="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <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="Link to this heading">¶</a></h3> <p>Report if the client provided a certificate at least once over the TLS session this connection belongs to.</p> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <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="Link to this heading">¶</a></h3> <p>Report if the client provided a certificate over the current connection.</p> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <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="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <section id="string-ssl-version"> <span id="proxy-ssl-version"></span><h3>STRING ssl_version()<a class="headerlink" href="#string-ssl-version" title="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <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="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <section id="string-ssl-cipher"> <span id="proxy-ssl-cipher"></span><h3>STRING ssl_cipher()<a class="headerlink" href="#string-ssl-cipher" title="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <section id="string-cert-sign"> <span id="proxy-cert-sign"></span><h3>STRING cert_sign()<a class="headerlink" href="#string-cert-sign" title="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <section id="string-cert-key"> <span id="proxy-cert-key"></span><h3>STRING cert_key()<a class="headerlink" href="#string-cert-key" title="Link to this heading">¶</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> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> </section> <section id="see-also"> <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Link to this heading">¶</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> </section> <section id="copyright"> <h2>COPYRIGHT<a class="headerlink" href="#copyright" title="Link to this heading">¶</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> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <div> <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> </div> <div> <h4>Previous topic</h4> <p class="topless"><a href="vmod_h2.html" title="previous chapter">VMOD h2 - Module to control the built-in HTTP2 transport</a></p> </div> <div> <h4>Next topic</h4> <p class="topless"><a href="vmod_purge.html" title="next chapter">VMOD purge - Varnish Purge Module</a></p> </div> <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" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>document.getElementById('searchbox').style.display = "block"</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_h2.html" title="VMOD h2 - Module to control the built-in HTTP2 transport" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.5.0 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> 7.2.6. </div> </body> </html>