CINXE.COM
Reverse Proxy - GOST
<!doctype html> <html lang="en" class="no-js"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="prev" href="../port-forwarding/"> <link rel="next" href="../reverse-proxy-tunnel/"> <link rel="icon" href="../../images/favicon.ico"> <meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.32"> <title>Reverse Proxy - GOST</title> <link rel="stylesheet" href="../../assets/stylesheets/main.3cba04c6.min.css"> <link rel="stylesheet" href="../../assets/stylesheets/palette.06af60db.min.css"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"> <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style> <script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script> <script id="__analytics">function __md_analytics(){function n(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],n("js",new Date),n("config","G-V295TSM2WT"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){this.value&&n("event","search",{search_term:this.value})}),document$.subscribe(function(){var a=document.forms.feedback;if(void 0!==a)for(var e of a.querySelectorAll("[type=submit]"))e.addEventListener("click",function(e){e.preventDefault();var t=document.location.pathname,e=this.getAttribute("data-md-value");n("event","feedback",{page:t,data:e}),a.firstElementChild.disabled=!0;e=a.querySelector(".md-feedback__note [data-md-value='"+e+"']");e&&(e.hidden=!1)}),a.hidden=!1}),location$.subscribe(function(e){n("config","G-V295TSM2WT",{page_path:e.pathname})})});var e=document.createElement("script");e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=G-V295TSM2WT",document.getElementById("__analytics").insertAdjacentElement("afterEnd",e)}</script> <script>"undefined"!=typeof __md_analytics&&__md_analytics()</script> </head> <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo"> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> <label class="md-overlay" for="__drawer"></label> <div data-md-component="skip"> <a href="#reverse-proxy" class="md-skip"> Skip to content </a> </div> <div data-md-component="announce"> <aside class="md-banner"> <div class="md-banner__inner md-grid md-typeset"> GOST v3 is under development, stay tuned! </div> </aside> </div> <header class="md-header md-header--shadow" data-md-component="header"> <nav class="md-header__inner md-grid" aria-label="Header"> <a href="../.." title="GOST" class="md-header__button md-logo" aria-label="GOST" data-md-component="logo"> <img src="../../images/gost.png" alt="logo"> </a> <label class="md-header__button md-icon" for="__drawer"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg> </label> <div class="md-header__title" data-md-component="header-title"> <div class="md-header__ellipsis"> <div class="md-header__topic"> <span class="md-ellipsis"> GOST </span> </div> <div class="md-header__topic" data-md-component="header-topic"> <span class="md-ellipsis"> Reverse Proxy </span> </div> </div> </div> <form class="md-header__option" data-md-component="palette"> <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo" aria-label="Light mode" type="radio" name="__palette" id="__palette_0"> <label class="md-header__button md-icon" title="Light mode" for="__palette_1" hidden> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0-7 2.39 3.42C13.65 5.15 12.84 5 12 5c-.84 0-1.65.15-2.39.42L12 2M3.34 7l4.16-.35A7.2 7.2 0 0 0 5.94 8.5c-.44.74-.69 1.5-.83 2.29L3.34 7m.02 10 1.76-3.77a7.131 7.131 0 0 0 2.38 4.14L3.36 17M20.65 7l-1.77 3.79a7.023 7.023 0 0 0-2.38-4.15l4.15.36m-.01 10-4.14.36c.59-.51 1.12-1.14 1.54-1.86.42-.73.69-1.5.83-2.29L20.64 17M12 22l-2.41-3.44c.74.27 1.55.44 2.41.44.82 0 1.63-.17 2.37-.44L12 22Z"/></svg> </label> <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Dark mode" type="radio" name="__palette" id="__palette_1"> <label class="md-header__button md-icon" title="Dark mode" for="__palette_0" hidden> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3 3.19.09m3.5 6.91-1.64 1.25.59 1.98-1.7-1.17-1.7 1.17.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95 2.06.05m-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14.4-.4.82-.76 1.27-1.08.75-.53 1.93.36 1.85 1.19-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82-2.81 3.14-2.7 7.96.31 10.98 3.02 3.01 7.84 3.12 10.98.31Z"/></svg> </label> </form> <script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script> <div class="md-header__option"> <div class="md-select"> <button class="md-header__button md-icon" aria-label="Select language"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m12.87 15.07-2.54-2.51.03-.03A17.52 17.52 0 0 0 14.07 6H17V4h-7V2H8v2H1v2h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04M18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12m-2.62 7 1.62-4.33L19.12 17h-3.24Z"/></svg> </button> <div class="md-select__inner"> <ul class="md-select__list"> <li class="md-select__item"> <a href="/en/" hreflang="en" class="md-select__link"> English </a> </li> <li class="md-select__item"> <a href="/" hreflang="zh" class="md-select__link"> 中文 </a> </li> </ul> </div> </div> </div> <label class="md-header__button md-icon" for="__search"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg> </label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" name="search"> <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required> <label class="md-search__icon md-icon" for="__search"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg> </label> <nav class="md-search__options" aria-label="Search"> <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg> </button> </nav> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix> <div class="md-search-result" data-md-component="search-result"> <div class="md-search-result__meta"> Initializing search </div> <ol class="md-search-result__list" role="presentation"></ol> </div> </div> </div> </div> </div> <div class="md-header__source"> <a href="https://github.com/go-gost/gost" title="Go to repository" class="md-source" data-md-component="source"> <div class="md-source__icon md-icon"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg> </div> <div class="md-source__repository"> go-gost/gost </div> </a> </div> </nav> </header> <div class="md-container" data-md-component="container"> <main class="md-main" data-md-component="main"> <div class="md-main__inner md-grid"> <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" > <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0"> <label class="md-nav__title" for="__drawer"> <a href="../.." title="GOST" class="md-nav__button md-logo" aria-label="GOST" data-md-component="logo"> <img src="../../images/gost.png" alt="logo"> </a> GOST </label> <div class="md-nav__source"> <a href="https://github.com/go-gost/gost" title="Go to repository" class="md-source" data-md-component="source"> <div class="md-source__icon md-icon"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg> </div> <div class="md-source__repository"> go-gost/gost </div> </a> </div> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../.." class="md-nav__link"> <span class="md-ellipsis"> Welcome </span> </a> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" > <label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0"> <span class="md-ellipsis"> Getting Started </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_2"> <span class="md-nav__icon md-icon"></span> Getting Started </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../../getting-started/quick-start/" class="md-nav__link"> <span class="md-ellipsis"> Quick Start </span> </a> </li> <li class="md-nav__item"> <a href="../../getting-started/configuration-overview/" class="md-nav__link"> <span class="md-ellipsis"> Configuration </span> </a> </li> <li class="md-nav__item"> <a href="../../getting-started/faq/" class="md-nav__link"> <span class="md-ellipsis"> FAQs </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" > <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0"> <span class="md-ellipsis"> Concepts </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_3"> <span class="md-nav__icon md-icon"></span> Concepts </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../../concepts/architecture/" class="md-nav__link"> <span class="md-ellipsis"> Overview </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/proxy/" class="md-nav__link"> <span class="md-ellipsis"> Proxy and Tunnel </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/service/" class="md-nav__link"> <span class="md-ellipsis"> Service </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/chain/" class="md-nav__link"> <span class="md-ellipsis"> Chain </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/hop/" class="md-nav__link"> <span class="md-ellipsis"> Hop </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/selector/" class="md-nav__link"> <span class="md-ellipsis"> Selector </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/auth/" class="md-nav__link"> <span class="md-ellipsis"> Authentication </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/bypass/" class="md-nav__link"> <span class="md-ellipsis"> Bypass </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/load-balancing/" class="md-nav__link"> <span class="md-ellipsis"> Load Balancing </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/limiter/" class="md-nav__link"> <span class="md-ellipsis"> Limiter </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/admission/" class="md-nav__link"> <span class="md-ellipsis"> Admission Control </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/resolver/" class="md-nav__link"> <span class="md-ellipsis"> DNS Resolver </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/hosts/" class="md-nav__link"> <span class="md-ellipsis"> Host-IP Mapping </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/ingress/" class="md-nav__link"> <span class="md-ellipsis"> Ingress </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/router/" class="md-nav__link"> <span class="md-ellipsis"> Router </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/sd/" class="md-nav__link"> <span class="md-ellipsis"> Service Discovery </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/recorder/" class="md-nav__link"> <span class="md-ellipsis"> Recorder </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/observer/" class="md-nav__link"> <span class="md-ellipsis"> Observer </span> </a> </li> <li class="md-nav__item"> <a href="../../concepts/plugin/" class="md-nav__link"> <span class="md-ellipsis"> Plugin System </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--active md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" checked> <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0"> <span class="md-ellipsis"> Tutorials </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="true"> <label class="md-nav__title" for="__nav_4"> <span class="md-nav__icon md-icon"></span> Tutorials </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_1" > <label class="md-nav__link" for="__nav_4_1" id="__nav_4_1_label" tabindex="0"> <span class="md-ellipsis"> Protocols </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_1_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_4_1"> <span class="md-nav__icon md-icon"></span> Protocols </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../protocols/overview/" class="md-nav__link"> <span class="md-ellipsis"> Overview </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/http/" class="md-nav__link"> <span class="md-ellipsis"> HTTP </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/http2/" class="md-nav__link"> <span class="md-ellipsis"> HTTP2 </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/http3/" class="md-nav__link"> <span class="md-ellipsis"> HTTP3 </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/socks/" class="md-nav__link"> <span class="md-ellipsis"> SOCKSv4/v5 </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/ss/" class="md-nav__link"> <span class="md-ellipsis"> Shadowsocks </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/sni/" class="md-nav__link"> <span class="md-ellipsis"> SNI </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/relay/" class="md-nav__link"> <span class="md-ellipsis"> Relay </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/tls/" class="md-nav__link"> <span class="md-ellipsis"> TLS </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/dtls/" class="md-nav__link"> <span class="md-ellipsis"> DTLS </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/ws/" class="md-nav__link"> <span class="md-ellipsis"> Websocket </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/grpc/" class="md-nav__link"> <span class="md-ellipsis"> gRPC </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/quic/" class="md-nav__link"> <span class="md-ellipsis"> QUIC </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/kcp/" class="md-nav__link"> <span class="md-ellipsis"> KCP </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/ssh/" class="md-nav__link"> <span class="md-ellipsis"> SSH </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/mtcp/" class="md-nav__link"> <span class="md-ellipsis"> MTCP </span> </a> </li> <li class="md-nav__item"> <a href="../protocols/pht/" class="md-nav__link"> <span class="md-ellipsis"> PHT </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_2" > <label class="md-nav__link" for="__nav_4_2" id="__nav_4_2_label" tabindex="0"> <span class="md-ellipsis"> WebAPI </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_2_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_4_2"> <span class="md-nav__icon md-icon"></span> WebAPI </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../api/overview/" class="md-nav__link"> <span class="md-ellipsis"> Overview </span> </a> </li> <li class="md-nav__item"> <a href="../api/config/" class="md-nav__link"> <span class="md-ellipsis"> Dynamic Configuration </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="../tls/" class="md-nav__link"> <span class="md-ellipsis"> TLS </span> </a> </li> <li class="md-nav__item"> <a href="../http-tunnel/" class="md-nav__link"> <span class="md-ellipsis"> HTTP Tunnel </span> </a> </li> <li class="md-nav__item"> <a href="../port-forwarding/" class="md-nav__link"> <span class="md-ellipsis"> Port Forwarding </span> </a> </li> <li class="md-nav__item md-nav__item--active"> <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc"> <label class="md-nav__link md-nav__link--active" for="__toc"> <span class="md-ellipsis"> Reverse Proxy </span> <span class="md-nav__icon md-icon"></span> </label> <a href="./" class="md-nav__link md-nav__link--active"> <span class="md-ellipsis"> Reverse Proxy </span> </a> <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> <label class="md-nav__title" for="__toc"> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> <li class="md-nav__item"> <a href="#local-port-forwarding" class="md-nav__link"> <span class="md-ellipsis"> Local Port Forwarding </span> </a> </li> <li class="md-nav__item"> <a href="#remote-port-forwarding" class="md-nav__link"> <span class="md-ellipsis"> Remote Port Forwarding </span> </a> </li> <li class="md-nav__item"> <a href="#request-routing" class="md-nav__link"> <span class="md-ellipsis"> Request Routing </span> </a> <nav class="md-nav" aria-label="Request Routing"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#conditional-filtering" class="md-nav__link"> <span class="md-ellipsis"> Conditional Filtering </span> </a> <nav class="md-nav" aria-label="Conditional Filtering"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#hostname-filtering" class="md-nav__link"> <span class="md-ellipsis"> Hostname Filtering </span> </a> </li> <li class="md-nav__item"> <a href="#protocol-filtering" class="md-nav__link"> <span class="md-ellipsis"> Protocol Filtering </span> </a> </li> <li class="md-nav__item"> <a href="#url-path-filtering" class="md-nav__link"> <span class="md-ellipsis"> URL Path Filtering </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="#rule-matching" class="md-nav__link"> <span class="md-ellipsis"> Rule Matching </span> </a> <nav class="md-nav" aria-label="Rule Matching"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#rule" class="md-nav__link"> <span class="md-ellipsis"> Rule </span> </a> </li> <li class="md-nav__item"> <a href="#priority" class="md-nav__link"> <span class="md-ellipsis"> Priority </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="#http-request-settings" class="md-nav__link"> <span class="md-ellipsis"> HTTP Request Settings </span> </a> <nav class="md-nav" aria-label="HTTP Request Settings"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#rewrite-host-header" class="md-nav__link"> <span class="md-ellipsis"> Rewrite Host Header </span> </a> </li> <li class="md-nav__item"> <a href="#custom-request-header" class="md-nav__link"> <span class="md-ellipsis"> Custom Request Header </span> </a> </li> <li class="md-nav__item"> <a href="#custom-response-header" class="md-nav__link"> <span class="md-ellipsis"> Custom Response Header </span> </a> </li> <li class="md-nav__item"> <a href="#http-basic-authentication" class="md-nav__link"> <span class="md-ellipsis"> HTTP Basic Authentication </span> </a> </li> <li class="md-nav__item"> <a href="#rewrite-url-path" class="md-nav__link"> <span class="md-ellipsis"> Rewrite URL Path </span> </a> </li> <li class="md-nav__item"> <a href="#rewrite-response-body" class="md-nav__link"> <span class="md-ellipsis"> Rewrite Response Body </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="#tls-settings" class="md-nav__link"> <span class="md-ellipsis"> TLS Settings </span> </a> </li> <li class="md-nav__item"> <a href="#forwarding-tunnel" class="md-nav__link"> <span class="md-ellipsis"> Forwarding Tunnel </span> </a> <nav class="md-nav" aria-label="Forwarding Tunnel"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#tls" class="md-nav__link"> <span class="md-ellipsis"> TLS </span> </a> </li> <li class="md-nav__item"> <a href="#http3" class="md-nav__link"> <span class="md-ellipsis"> HTTP3 </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="../reverse-proxy-tunnel/" class="md-nav__link"> <span class="md-ellipsis"> Reverse Proxy Tunnel </span> </a> </li> <li class="md-nav__item"> <a href="../reverse-proxy-tunnel-ha/" class="md-nav__link"> <span class="md-ellipsis"> Reverse Proxy Tunnel - HA </span> </a> </li> <li class="md-nav__item"> <a href="../sniffing/" class="md-nav__link"> <span class="md-ellipsis"> Traffic Sniffing and MITM </span> </a> </li> <li class="md-nav__item"> <a href="../file/" class="md-nav__link"> <span class="md-ellipsis"> HTTP File Server </span> </a> </li> <li class="md-nav__item"> <a href="../probe-resistance/" class="md-nav__link"> <span class="md-ellipsis"> Probe Resistance </span> </a> </li> <li class="md-nav__item"> <a href="../proxy-protocol/" class="md-nav__link"> <span class="md-ellipsis"> PROXY Protocol </span> </a> </li> <li class="md-nav__item"> <a href="../dns/" class="md-nav__link"> <span class="md-ellipsis"> DNS Proxy </span> </a> </li> <li class="md-nav__item"> <a href="../redirect/" class="md-nav__link"> <span class="md-ellipsis"> Transparent Proxy </span> </a> </li> <li class="md-nav__item"> <a href="../multi-homed/" class="md-nav__link"> <span class="md-ellipsis"> Multi-homed Host </span> </a> </li> <li class="md-nav__item"> <a href="../tuntap/" class="md-nav__link"> <span class="md-ellipsis"> TUN/TAP Device </span> </a> </li> <li class="md-nav__item"> <a href="../netns/" class="md-nav__link"> <span class="md-ellipsis"> Network Namespace </span> </a> </li> <li class="md-nav__item"> <a href="../icmp/" class="md-nav__link"> <span class="md-ellipsis"> ICMP Tunnel </span> </a> </li> <li class="md-nav__item"> <a href="../unix/" class="md-nav__link"> <span class="md-ellipsis"> Unix Domain Socket Redirector </span> </a> </li> <li class="md-nav__item"> <a href="../serial/" class="md-nav__link"> <span class="md-ellipsis"> Serial Port Redirector </span> </a> </li> <li class="md-nav__item"> <a href="../metrics/" class="md-nav__link"> <span class="md-ellipsis"> Prometheus Metrics </span> </a> </li> <li class="md-nav__item"> <a href="../log/" class="md-nav__link"> <span class="md-ellipsis"> Log </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" > <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0"> <span class="md-ellipsis"> References </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_5"> <span class="md-nav__icon md-icon"></span> References </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_1" > <label class="md-nav__link" for="__nav_5_1" id="__nav_5_1_label" tabindex="0"> <span class="md-ellipsis"> Configuration </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_1_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_5_1"> <span class="md-nav__icon md-icon"></span> Configuration </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../../reference/configuration/cmd/" class="md-nav__link"> <span class="md-ellipsis"> CLI </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/configuration/file/" class="md-nav__link"> <span class="md-ellipsis"> File </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" > <label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0"> <span class="md-ellipsis"> Listeners </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_5_2"> <span class="md-nav__icon md-icon"></span> Listeners </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../../reference/listeners/tcp/" class="md-nav__link"> <span class="md-ellipsis"> TCP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/udp/" class="md-nav__link"> <span class="md-ellipsis"> UDP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/tls/" class="md-nav__link"> <span class="md-ellipsis"> TLS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/mtls/" class="md-nav__link"> <span class="md-ellipsis"> MTLS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/ws/" class="md-nav__link"> <span class="md-ellipsis"> WS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/mws/" class="md-nav__link"> <span class="md-ellipsis"> MWS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/http2/" class="md-nav__link"> <span class="md-ellipsis"> HTTP2 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/h2/" class="md-nav__link"> <span class="md-ellipsis"> H2(C) </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/grpc/" class="md-nav__link"> <span class="md-ellipsis"> gRPC </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/quic/" class="md-nav__link"> <span class="md-ellipsis"> QUIC </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/pht/" class="md-nav__link"> <span class="md-ellipsis"> PHT </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/http3/" class="md-nav__link"> <span class="md-ellipsis"> HTTP3 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/kcp/" class="md-nav__link"> <span class="md-ellipsis"> KCP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/ssh/" class="md-nav__link"> <span class="md-ellipsis"> SSH </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/sshd/" class="md-nav__link"> <span class="md-ellipsis"> SSHD </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/red/" class="md-nav__link"> <span class="md-ellipsis"> RED </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/redu/" class="md-nav__link"> <span class="md-ellipsis"> REDU </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/rtcp/" class="md-nav__link"> <span class="md-ellipsis"> RTCP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/rudp/" class="md-nav__link"> <span class="md-ellipsis"> RUDP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/dns/" class="md-nav__link"> <span class="md-ellipsis"> DNS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/tun/" class="md-nav__link"> <span class="md-ellipsis"> TUN </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/tap/" class="md-nav__link"> <span class="md-ellipsis"> TAP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/icmp/" class="md-nav__link"> <span class="md-ellipsis"> ICMP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/ohttp/" class="md-nav__link"> <span class="md-ellipsis"> OHTTP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/otls/" class="md-nav__link"> <span class="md-ellipsis"> OTLS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/listeners/ftcp/" class="md-nav__link"> <span class="md-ellipsis"> FTCP </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3" > <label class="md-nav__link" for="__nav_5_3" id="__nav_5_3_label" tabindex="0"> <span class="md-ellipsis"> Handlers </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_3_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_5_3"> <span class="md-nav__icon md-icon"></span> Handlers </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../../reference/handlers/http/" class="md-nav__link"> <span class="md-ellipsis"> HTTP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/http2/" class="md-nav__link"> <span class="md-ellipsis"> HTTP2 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/socks4/" class="md-nav__link"> <span class="md-ellipsis"> SOCKS4 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/socks5/" class="md-nav__link"> <span class="md-ellipsis"> SOCKS5 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/auto/" class="md-nav__link"> <span class="md-ellipsis"> Auto </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/relay/" class="md-nav__link"> <span class="md-ellipsis"> Relay </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/tcp/" class="md-nav__link"> <span class="md-ellipsis"> TCP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/udp/" class="md-nav__link"> <span class="md-ellipsis"> UDP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/rtcp/" class="md-nav__link"> <span class="md-ellipsis"> RTCP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/rudp/" class="md-nav__link"> <span class="md-ellipsis"> RUDP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/ss/" class="md-nav__link"> <span class="md-ellipsis"> SS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/ssu/" class="md-nav__link"> <span class="md-ellipsis"> SSU </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/sni/" class="md-nav__link"> <span class="md-ellipsis"> SNI </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/sshd/" class="md-nav__link"> <span class="md-ellipsis"> SSHD </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/dns/" class="md-nav__link"> <span class="md-ellipsis"> DNS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/red/" class="md-nav__link"> <span class="md-ellipsis"> RED </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/redu/" class="md-nav__link"> <span class="md-ellipsis"> REDU </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/tun/" class="md-nav__link"> <span class="md-ellipsis"> TUN </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/handlers/tap/" class="md-nav__link"> <span class="md-ellipsis"> TAP </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4" > <label class="md-nav__link" for="__nav_5_4" id="__nav_5_4_label" tabindex="0"> <span class="md-ellipsis"> Dialers </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_4_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_5_4"> <span class="md-nav__icon md-icon"></span> Dialers </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../../reference/dialers/tcp/" class="md-nav__link"> <span class="md-ellipsis"> TCP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/udp/" class="md-nav__link"> <span class="md-ellipsis"> UDP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/tls/" class="md-nav__link"> <span class="md-ellipsis"> TLS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/mtls/" class="md-nav__link"> <span class="md-ellipsis"> MTLS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/ws/" class="md-nav__link"> <span class="md-ellipsis"> WS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/mws/" class="md-nav__link"> <span class="md-ellipsis"> MWS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/http2/" class="md-nav__link"> <span class="md-ellipsis"> HTTP2 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/h2/" class="md-nav__link"> <span class="md-ellipsis"> H2(C) </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/grpc/" class="md-nav__link"> <span class="md-ellipsis"> gRPC </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/quic/" class="md-nav__link"> <span class="md-ellipsis"> QUIC </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/pht/" class="md-nav__link"> <span class="md-ellipsis"> PHT </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/http3/" class="md-nav__link"> <span class="md-ellipsis"> HTTP3 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/kcp/" class="md-nav__link"> <span class="md-ellipsis"> KCP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/ssh/" class="md-nav__link"> <span class="md-ellipsis"> SSH </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/sshd/" class="md-nav__link"> <span class="md-ellipsis"> SSHD </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/icmp/" class="md-nav__link"> <span class="md-ellipsis"> ICMP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/ohttp/" class="md-nav__link"> <span class="md-ellipsis"> OHTTP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/otls/" class="md-nav__link"> <span class="md-ellipsis"> OTLS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/dialers/ftcp/" class="md-nav__link"> <span class="md-ellipsis"> FTCP </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_5" > <label class="md-nav__link" for="__nav_5_5" id="__nav_5_5_label" tabindex="0"> <span class="md-ellipsis"> Connectors </span> <span class="md-nav__icon md-icon"></span> </label> <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_5_label" aria-expanded="false"> <label class="md-nav__title" for="__nav_5_5"> <span class="md-nav__icon md-icon"></span> Connectors </label> <ul class="md-nav__list" data-md-scrollfix> <li class="md-nav__item"> <a href="../../reference/connectors/http/" class="md-nav__link"> <span class="md-ellipsis"> HTTP </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/http2/" class="md-nav__link"> <span class="md-ellipsis"> HTTP2 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/socks4/" class="md-nav__link"> <span class="md-ellipsis"> SOCKS4 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/socks5/" class="md-nav__link"> <span class="md-ellipsis"> SOCKS5 </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/forward/" class="md-nav__link"> <span class="md-ellipsis"> Forward </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/relay/" class="md-nav__link"> <span class="md-ellipsis"> Relay </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/ss/" class="md-nav__link"> <span class="md-ellipsis"> SS </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/ssu/" class="md-nav__link"> <span class="md-ellipsis"> SSU </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/sni/" class="md-nav__link"> <span class="md-ellipsis"> SNI </span> </a> </li> <li class="md-nav__item"> <a href="../../reference/connectors/sshd/" class="md-nav__link"> <span class="md-ellipsis"> SSHD </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="../../donation/" class="md-nav__link"> <span class="md-ellipsis"> Donation </span> </a> </li> <li class="md-nav__item"> <a href="https://gost.plus" class="md-nav__link"> <span class="md-ellipsis"> GOST+ </span> </a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" > <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> <label class="md-nav__title" for="__toc"> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> <li class="md-nav__item"> <a href="#local-port-forwarding" class="md-nav__link"> <span class="md-ellipsis"> Local Port Forwarding </span> </a> </li> <li class="md-nav__item"> <a href="#remote-port-forwarding" class="md-nav__link"> <span class="md-ellipsis"> Remote Port Forwarding </span> </a> </li> <li class="md-nav__item"> <a href="#request-routing" class="md-nav__link"> <span class="md-ellipsis"> Request Routing </span> </a> <nav class="md-nav" aria-label="Request Routing"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#conditional-filtering" class="md-nav__link"> <span class="md-ellipsis"> Conditional Filtering </span> </a> <nav class="md-nav" aria-label="Conditional Filtering"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#hostname-filtering" class="md-nav__link"> <span class="md-ellipsis"> Hostname Filtering </span> </a> </li> <li class="md-nav__item"> <a href="#protocol-filtering" class="md-nav__link"> <span class="md-ellipsis"> Protocol Filtering </span> </a> </li> <li class="md-nav__item"> <a href="#url-path-filtering" class="md-nav__link"> <span class="md-ellipsis"> URL Path Filtering </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="#rule-matching" class="md-nav__link"> <span class="md-ellipsis"> Rule Matching </span> </a> <nav class="md-nav" aria-label="Rule Matching"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#rule" class="md-nav__link"> <span class="md-ellipsis"> Rule </span> </a> </li> <li class="md-nav__item"> <a href="#priority" class="md-nav__link"> <span class="md-ellipsis"> Priority </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="#http-request-settings" class="md-nav__link"> <span class="md-ellipsis"> HTTP Request Settings </span> </a> <nav class="md-nav" aria-label="HTTP Request Settings"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#rewrite-host-header" class="md-nav__link"> <span class="md-ellipsis"> Rewrite Host Header </span> </a> </li> <li class="md-nav__item"> <a href="#custom-request-header" class="md-nav__link"> <span class="md-ellipsis"> Custom Request Header </span> </a> </li> <li class="md-nav__item"> <a href="#custom-response-header" class="md-nav__link"> <span class="md-ellipsis"> Custom Response Header </span> </a> </li> <li class="md-nav__item"> <a href="#http-basic-authentication" class="md-nav__link"> <span class="md-ellipsis"> HTTP Basic Authentication </span> </a> </li> <li class="md-nav__item"> <a href="#rewrite-url-path" class="md-nav__link"> <span class="md-ellipsis"> Rewrite URL Path </span> </a> </li> <li class="md-nav__item"> <a href="#rewrite-response-body" class="md-nav__link"> <span class="md-ellipsis"> Rewrite Response Body </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item"> <a href="#tls-settings" class="md-nav__link"> <span class="md-ellipsis"> TLS Settings </span> </a> </li> <li class="md-nav__item"> <a href="#forwarding-tunnel" class="md-nav__link"> <span class="md-ellipsis"> Forwarding Tunnel </span> </a> <nav class="md-nav" aria-label="Forwarding Tunnel"> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="#tls" class="md-nav__link"> <span class="md-ellipsis"> TLS </span> </a> </li> <li class="md-nav__item"> <a href="#http3" class="md-nav__link"> <span class="md-ellipsis"> HTTP3 </span> </a> </li> </ul> </nav> </li> </ul> </nav> </div> </div> </div> <div class="md-content" data-md-component="content"> <article class="md-content__inner md-typeset"> <h1 id="reverse-proxy">Reverse Proxy<a class="headerlink" href="#reverse-proxy" title="Permanent link">¶</a></h1> <p><a href="https://en.wikipedia.org/wiki/Reverse_proxy">Reverse Proxy</a> is a type of proxy service. According to the client's request, the server obtains resources from one or more groups of backend servers (such as web servers) related to it, and then returns these resources to the client. The client only knows the IP address of the reverse proxy, without knowing the existence of server clusters behind proxy servers.</p> <p>The <a href="../port-forwarding/">port forwarding</a> service in GOST can also be regarded as a reverse proxy with limited functions, because it can only forward to a fixed one or a set of backend services.</p> <p>Reverse proxy is an extension of the port forwarding service, which relies on the port forwarding function, and obtains the target host information in a specific protocol (currently supports HTTP/HTTPS) by sniffing the forwarded data.</p> <h2 id="local-port-forwarding">Local Port Forwarding<a class="headerlink" href="#local-port-forwarding" title="Permanent link">¶</a></h2> <div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https</span> <a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:443</span> <a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">google</span> <a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">www.google.com:443</span> <a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="w"> </span><span class="c1"># host: www.google.com</span> <a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`www.google.com`)</span> <a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">github</span> <a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">github.com:443</span> <a id="__codelineno-0-20" name="__codelineno-0-20" href="#__codelineno-0-20"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-0-21" name="__codelineno-0-21" href="#__codelineno-0-21"></a><span class="w"> </span><span class="c1"># host: *.github.com</span> <a id="__codelineno-0-22" name="__codelineno-0-22" href="#__codelineno-0-22"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-0-23" name="__codelineno-0-23" href="#__codelineno-0-23"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`*.github.com`)</span> <a id="__codelineno-0-24" name="__codelineno-0-24" href="#__codelineno-0-24"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-0-25" name="__codelineno-0-25" href="#__codelineno-0-25"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-0-26" name="__codelineno-0-26" href="#__codelineno-0-26"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-0-27" name="__codelineno-0-27" href="#__codelineno-0-27"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-0-28" name="__codelineno-0-28" href="#__codelineno-0-28"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-0-29" name="__codelineno-0-29" href="#__codelineno-0-29"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-0-30" name="__codelineno-0-30" href="#__codelineno-0-30"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-0-31" name="__codelineno-0-31" href="#__codelineno-0-31"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-0-32" name="__codelineno-0-32" href="#__codelineno-0-32"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-0-33" name="__codelineno-0-33" href="#__codelineno-0-33"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-0-34" name="__codelineno-0-34" href="#__codelineno-0-34"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-0-35" name="__codelineno-0-35" href="#__codelineno-0-35"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-0-36" name="__codelineno-0-36" href="#__codelineno-0-36"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-0-37" name="__codelineno-0-37" href="#__codelineno-0-37"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-0-38" name="__codelineno-0-38" href="#__codelineno-0-38"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-0-39" name="__codelineno-0-39" href="#__codelineno-0-39"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> <a id="__codelineno-0-40" name="__codelineno-0-40" href="#__codelineno-0-40"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-org</span> <a id="__codelineno-0-41" name="__codelineno-0-41" href="#__codelineno-0-41"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.org:80</span> <a id="__codelineno-0-42" name="__codelineno-0-42" href="#__codelineno-0-42"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-0-43" name="__codelineno-0-43" href="#__codelineno-0-43"></a><span class="w"> </span><span class="c1"># host: example.org</span> <a id="__codelineno-0-44" name="__codelineno-0-44" href="#__codelineno-0-44"></a><span class="w"> </span><span class="c1"># path: /</span> <a id="__codelineno-0-45" name="__codelineno-0-45" href="#__codelineno-0-45"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-0-46" name="__codelineno-0-46" href="#__codelineno-0-46"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.org`) && PathPrefix(`/`)</span> </code></pre></div> <p>Use the <code>sniffing</code> option to enable traffic sniffing, and set routing conditions or rules through the <code>filter</code> or <code>matcher.rule</code> options in <code>forwarder.nodes</code>.</p> <p>When traffic sniffing is enabled, the forwarding service will apply the matching conditions (filter) or matching rules (matcher.rule) set in the node of the forwarder to the client's request information to filter out the final forwarding target node.</p> <p><img alt="Reverse Proxy - TCP Port Forwarding" src="../../images/reverse-proxy-tcp.png" /> </p> <p><code>filter.host</code> also supports wildcards, *.example.com or .example.com matches example.com and its subdomains: abc.example.com, def.abc.example.com, etc.</p> <p>At this time, the corresponding domain name can be resolved to the local and then accessed through the reverse proxy:</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>curl<span class="w"> </span>--resolve<span class="w"> </span>www.google.com:443:127.0.0.1<span class="w"> </span>https://www.google.com </code></pre></div> <div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>curl<span class="w"> </span>--resolve<span class="w"> </span>example.com:80:127.0.0.1<span class="w"> </span>http://example.com </code></pre></div> <h2 id="remote-port-forwarding">Remote Port Forwarding<a class="headerlink" href="#remote-port-forwarding" title="Permanent link">¶</a></h2> <p>Remote port forwarding services can also sniff traffic.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https</span> <a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:443</span> <a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">rtcp</span> <a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">rtcp</span> <a id="__codelineno-3-10" name="__codelineno-3-10" href="#__codelineno-3-10"></a><span class="w"> </span><span class="nt">chain</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">chain-0</span> <a id="__codelineno-3-11" name="__codelineno-3-11" href="#__codelineno-3-11"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-3-12" name="__codelineno-3-12" href="#__codelineno-3-12"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-3-13" name="__codelineno-3-13" href="#__codelineno-3-13"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">local-0</span> <a id="__codelineno-3-14" name="__codelineno-3-14" href="#__codelineno-3-14"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.1:443</span> <a id="__codelineno-3-15" name="__codelineno-3-15" href="#__codelineno-3-15"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-3-16" name="__codelineno-3-16" href="#__codelineno-3-16"></a><span class="w"> </span><span class="c1"># host: srv-0.local</span> <a id="__codelineno-3-17" name="__codelineno-3-17" href="#__codelineno-3-17"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-3-18" name="__codelineno-3-18" href="#__codelineno-3-18"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`srv-0.local`)</span> <a id="__codelineno-3-19" name="__codelineno-3-19" href="#__codelineno-3-19"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">local-1</span> <a id="__codelineno-3-20" name="__codelineno-3-20" href="#__codelineno-3-20"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.2:443</span> <a id="__codelineno-3-21" name="__codelineno-3-21" href="#__codelineno-3-21"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-3-22" name="__codelineno-3-22" href="#__codelineno-3-22"></a><span class="w"> </span><span class="c1"># host: srv-1.local</span> <a id="__codelineno-3-23" name="__codelineno-3-23" href="#__codelineno-3-23"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-3-24" name="__codelineno-3-24" href="#__codelineno-3-24"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`srv-1.local`)</span> <a id="__codelineno-3-25" name="__codelineno-3-25" href="#__codelineno-3-25"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">fallback</span> <a id="__codelineno-3-26" name="__codelineno-3-26" href="#__codelineno-3-26"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.2.1:443</span> <a id="__codelineno-3-27" name="__codelineno-3-27" href="#__codelineno-3-27"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-3-28" name="__codelineno-3-28" href="#__codelineno-3-28"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-3-29" name="__codelineno-3-29" href="#__codelineno-3-29"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-3-30" name="__codelineno-3-30" href="#__codelineno-3-30"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">rtcp</span> <a id="__codelineno-3-31" name="__codelineno-3-31" href="#__codelineno-3-31"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-3-32" name="__codelineno-3-32" href="#__codelineno-3-32"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-3-33" name="__codelineno-3-33" href="#__codelineno-3-33"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-3-34" name="__codelineno-3-34" href="#__codelineno-3-34"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">rtcp</span> <a id="__codelineno-3-35" name="__codelineno-3-35" href="#__codelineno-3-35"></a><span class="w"> </span><span class="nt">chain</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">chain-0</span> <a id="__codelineno-3-36" name="__codelineno-3-36" href="#__codelineno-3-36"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-3-37" name="__codelineno-3-37" href="#__codelineno-3-37"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-3-38" name="__codelineno-3-38" href="#__codelineno-3-38"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">local-0</span> <a id="__codelineno-3-39" name="__codelineno-3-39" href="#__codelineno-3-39"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.1:80</span> <a id="__codelineno-3-40" name="__codelineno-3-40" href="#__codelineno-3-40"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-3-41" name="__codelineno-3-41" href="#__codelineno-3-41"></a><span class="w"> </span><span class="c1"># host: srv-0.local</span> <a id="__codelineno-3-42" name="__codelineno-3-42" href="#__codelineno-3-42"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-3-43" name="__codelineno-3-43" href="#__codelineno-3-43"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`srv-0.local`)</span> <a id="__codelineno-3-44" name="__codelineno-3-44" href="#__codelineno-3-44"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">local-1</span> <a id="__codelineno-3-45" name="__codelineno-3-45" href="#__codelineno-3-45"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.2:80</span> <a id="__codelineno-3-46" name="__codelineno-3-46" href="#__codelineno-3-46"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-3-47" name="__codelineno-3-47" href="#__codelineno-3-47"></a><span class="w"> </span><span class="c1"># host: srv-1.local</span> <a id="__codelineno-3-48" name="__codelineno-3-48" href="#__codelineno-3-48"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-3-49" name="__codelineno-3-49" href="#__codelineno-3-49"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`srv-1.local`)</span> <a id="__codelineno-3-50" name="__codelineno-3-50" href="#__codelineno-3-50"></a><span class="nt">chains</span><span class="p">:</span> <a id="__codelineno-3-51" name="__codelineno-3-51" href="#__codelineno-3-51"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">chain-0</span> <a id="__codelineno-3-52" name="__codelineno-3-52" href="#__codelineno-3-52"></a><span class="w"> </span><span class="nt">hops</span><span class="p">:</span> <a id="__codelineno-3-53" name="__codelineno-3-53" href="#__codelineno-3-53"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hop-0</span> <a id="__codelineno-3-54" name="__codelineno-3-54" href="#__codelineno-3-54"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-3-55" name="__codelineno-3-55" href="#__codelineno-3-55"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">node-0</span> <a id="__codelineno-3-56" name="__codelineno-3-56" href="#__codelineno-3-56"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">SERVER_IP:8443</span><span class="w"> </span> <a id="__codelineno-3-57" name="__codelineno-3-57" href="#__codelineno-3-57"></a><span class="w"> </span><span class="nt">connector</span><span class="p">:</span> <a id="__codelineno-3-58" name="__codelineno-3-58" href="#__codelineno-3-58"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">relay</span> <a id="__codelineno-3-59" name="__codelineno-3-59" href="#__codelineno-3-59"></a><span class="w"> </span><span class="nt">dialer</span><span class="p">:</span> <a id="__codelineno-3-60" name="__codelineno-3-60" href="#__codelineno-3-60"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">wss</span> </code></pre></div> <p><img alt="Reverse Proxy - Remote TCP Port Forwarding" src="../../images/reverse-proxy-rtcp.png" /> </p> <p>At this time, the corresponding domain name can be resolved to the server address to access the internal service through the reverse proxy:</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>curl<span class="w"> </span>--resolve<span class="w"> </span>srv-0.local:443:SERVER_IP<span class="w"> </span>https://srv-0.local </code></pre></div> <div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>curl<span class="w"> </span>--resolve<span class="w"> </span>srv-1.local:80:SERVER_IP<span class="w"> </span>http://srv-1.local </code></pre></div> <p>If the accessed target host does not match the hostname set by the node in the forwarder, when there are nodes without a hostname set, one of these nodes will be selected for use.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>curl<span class="w"> </span>--resolve<span class="w"> </span>srv-2.local:443:SERVER_IP<span class="w"> </span>https://srv-2.local </code></pre></div> <p>Since srv-2.local does not match the node, it will be forwarded to the fallback node (192.168.2.1:443).</p> <h2 id="request-routing">Request Routing<a class="headerlink" href="#request-routing" title="Permanent link">¶</a></h2> <p>There are two modes for routing requests to target nodes: conditional filtering and rule matching. When choosing between the two modes, rule matching takes precedence.</p> <h3 id="conditional-filtering">Conditional Filtering<a class="headerlink" href="#conditional-filtering" title="Permanent link">¶</a></h3> <p>The filter condition is set on the node through the <code>filter</code> option. When the request meets this filter condition, this node is a qualified node and will participate in the next step of target node selection.</p> <h4 id="hostname-filtering">Hostname Filtering<a class="headerlink" href="#hostname-filtering" title="Permanent link">¶</a></h4> <p>Set hostname filtering for a node via the <code>filter.host</code> option.</p> <p><code>filter.host</code> also supports wildcards, <code>*.example.com</code> or <code>.example.com</code> matches example.com and its subdomains abc.example.com, def.abc.example.com, etc.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-7-2" name="__codelineno-7-2" href="#__codelineno-7-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-7-3" name="__codelineno-7-3" href="#__codelineno-7-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-7-4" name="__codelineno-7-4" href="#__codelineno-7-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-7-5" name="__codelineno-7-5" href="#__codelineno-7-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-7-6" name="__codelineno-7-6" href="#__codelineno-7-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-7-7" name="__codelineno-7-7" href="#__codelineno-7-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-7-8" name="__codelineno-7-8" href="#__codelineno-7-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-7-9" name="__codelineno-7-9" href="#__codelineno-7-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-7-10" name="__codelineno-7-10" href="#__codelineno-7-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-7-11" name="__codelineno-7-11" href="#__codelineno-7-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-7-12" name="__codelineno-7-12" href="#__codelineno-7-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-7-13" name="__codelineno-7-13" href="#__codelineno-7-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-7-14" name="__codelineno-7-14" href="#__codelineno-7-14"></a><span class="w"> </span><span class="nt">filter</span><span class="p">:</span> <a id="__codelineno-7-15" name="__codelineno-7-15" href="#__codelineno-7-15"></a><span class="hll"><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com</span> </span><a id="__codelineno-7-16" name="__codelineno-7-16" href="#__codelineno-7-16"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-org</span> <a id="__codelineno-7-17" name="__codelineno-7-17" href="#__codelineno-7-17"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.org:80</span> <a id="__codelineno-7-18" name="__codelineno-7-18" href="#__codelineno-7-18"></a><span class="w"> </span><span class="nt">filter</span><span class="p">:</span> <a id="__codelineno-7-19" name="__codelineno-7-19" href="#__codelineno-7-19"></a><span class="hll"><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="err">*</span><span class="l l-Scalar l-Scalar-Plain">.example.org</span> </span></code></pre></div> <h4 id="protocol-filtering">Protocol Filtering<a class="headerlink" href="#protocol-filtering" title="Permanent link">¶</a></h4> <p>The protocol type filter is set through the <code>filter.protocol</code> option. When the corresponding type of traffic is sniffed, it will be forwarded to this node.</p> <p>Currently supported application protocols are:</p> <ul> <li><code>http</code> - HTTP traffic.</li> <li><code>tls</code> - TLS traffic.</li> <li><code>ssh</code> - SSH traffic.</li> </ul> <div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-8-2" name="__codelineno-8-2" href="#__codelineno-8-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">service-0</span> <a id="__codelineno-8-3" name="__codelineno-8-3" href="#__codelineno-8-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:8000</span> <a id="__codelineno-8-4" name="__codelineno-8-4" href="#__codelineno-8-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-8-5" name="__codelineno-8-5" href="#__codelineno-8-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-8-7" name="__codelineno-8-7" href="#__codelineno-8-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-8-8" name="__codelineno-8-8" href="#__codelineno-8-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-8-9" name="__codelineno-8-9" href="#__codelineno-8-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-8-10" name="__codelineno-8-10" href="#__codelineno-8-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-8-11" name="__codelineno-8-11" href="#__codelineno-8-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-8-12" name="__codelineno-8-12" href="#__codelineno-8-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http-server</span> <a id="__codelineno-8-13" name="__codelineno-8-13" href="#__codelineno-8-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-8-14" name="__codelineno-8-14" href="#__codelineno-8-14"></a><span class="w"> </span><span class="nt">filter</span><span class="p">:</span> <a id="__codelineno-8-15" name="__codelineno-8-15" href="#__codelineno-8-15"></a><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com</span> <a id="__codelineno-8-16" name="__codelineno-8-16" href="#__codelineno-8-16"></a><span class="hll"><span class="w"> </span><span class="nt">protocol</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> </span><a id="__codelineno-8-17" name="__codelineno-8-17" href="#__codelineno-8-17"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https-server</span> <a id="__codelineno-8-18" name="__codelineno-8-18" href="#__codelineno-8-18"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:443</span> <a id="__codelineno-8-19" name="__codelineno-8-19" href="#__codelineno-8-19"></a><span class="w"> </span><span class="nt">filter</span><span class="p">:</span> <a id="__codelineno-8-20" name="__codelineno-8-20" href="#__codelineno-8-20"></a><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com</span> <a id="__codelineno-8-21" name="__codelineno-8-21" href="#__codelineno-8-21"></a><span class="hll"><span class="w"> </span><span class="nt">protocol</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tls</span> </span><a id="__codelineno-8-22" name="__codelineno-8-22" href="#__codelineno-8-22"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ssh-server</span> <a id="__codelineno-8-23" name="__codelineno-8-23" href="#__codelineno-8-23"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:22</span> <a id="__codelineno-8-24" name="__codelineno-8-24" href="#__codelineno-8-24"></a><span class="w"> </span><span class="nt">filter</span><span class="p">:</span> <a id="__codelineno-8-25" name="__codelineno-8-25" href="#__codelineno-8-25"></a><span class="hll"><span class="w"> </span><span class="nt">protocol</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ssh</span> </span></code></pre></div> <h4 id="url-path-filtering">URL Path Filtering<a class="headerlink" href="#url-path-filtering" title="Permanent link">¶</a></h4> <p>Set the path prefix filtering for the node through the <code>filter.path</code> option. When sniffing HTTP traffic, the URL path prefix matching pattern is used to select the node.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-9-2" name="__codelineno-9-2" href="#__codelineno-9-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-9-3" name="__codelineno-9-3" href="#__codelineno-9-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-9-4" name="__codelineno-9-4" href="#__codelineno-9-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-9-5" name="__codelineno-9-5" href="#__codelineno-9-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-9-6" name="__codelineno-9-6" href="#__codelineno-9-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-9-7" name="__codelineno-9-7" href="#__codelineno-9-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-9-8" name="__codelineno-9-8" href="#__codelineno-9-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-9-9" name="__codelineno-9-9" href="#__codelineno-9-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-9-10" name="__codelineno-9-10" href="#__codelineno-9-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-9-11" name="__codelineno-9-11" href="#__codelineno-9-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-9-12" name="__codelineno-9-12" href="#__codelineno-9-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">target-0</span> <a id="__codelineno-9-13" name="__codelineno-9-13" href="#__codelineno-9-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.1:80</span> <a id="__codelineno-9-14" name="__codelineno-9-14" href="#__codelineno-9-14"></a><span class="w"> </span><span class="nt">filter</span><span class="p">:</span> <a id="__codelineno-9-15" name="__codelineno-9-15" href="#__codelineno-9-15"></a><span class="hll"><span class="w"> </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/</span> </span><a id="__codelineno-9-16" name="__codelineno-9-16" href="#__codelineno-9-16"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">target-1</span> <a id="__codelineno-9-17" name="__codelineno-9-17" href="#__codelineno-9-17"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.2:80</span> <a id="__codelineno-9-18" name="__codelineno-9-18" href="#__codelineno-9-18"></a><span class="w"> </span><span class="nt">filter</span><span class="p">:</span> <a id="__codelineno-9-19" name="__codelineno-9-19" href="#__codelineno-9-19"></a><span class="hll"><span class="w"> </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/test</span> </span></code></pre></div> <h3 id="rule-matching">Rule Matching<a class="headerlink" href="#rule-matching" title="Permanent link">¶</a></h3> <p>In addition to simple conditional filtering, request routing also integrates the more flexible <a href="https://doc.traefik.io/traefik/routing/routers/">rule-based routing</a> function in Traefik.</p> <p>The matching rule of the node can be set by the <code>matcher.rule</code> option. When the rule is set, <code>filter</code> will be ignored.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-10-2" name="__codelineno-10-2" href="#__codelineno-10-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-10-3" name="__codelineno-10-3" href="#__codelineno-10-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-10-4" name="__codelineno-10-4" href="#__codelineno-10-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-10-5" name="__codelineno-10-5" href="#__codelineno-10-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-10-6" name="__codelineno-10-6" href="#__codelineno-10-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-10-7" name="__codelineno-10-7" href="#__codelineno-10-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-10-8" name="__codelineno-10-8" href="#__codelineno-10-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-10-9" name="__codelineno-10-9" href="#__codelineno-10-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-10-10" name="__codelineno-10-10" href="#__codelineno-10-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-10-11" name="__codelineno-10-11" href="#__codelineno-10-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-10-12" name="__codelineno-10-12" href="#__codelineno-10-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">target-0</span> <a id="__codelineno-10-13" name="__codelineno-10-13" href="#__codelineno-10-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.1:80</span> <a id="__codelineno-10-14" name="__codelineno-10-14" href="#__codelineno-10-14"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-10-15" name="__codelineno-10-15" href="#__codelineno-10-15"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`www.example.com`) || Host(`www.example.org`)</span> </span><a id="__codelineno-10-16" name="__codelineno-10-16" href="#__codelineno-10-16"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">target-1</span> <a id="__codelineno-10-17" name="__codelineno-10-17" href="#__codelineno-10-17"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.2:80</span> <a id="__codelineno-10-18" name="__codelineno-10-18" href="#__codelineno-10-18"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-10-19" name="__codelineno-10-19" href="#__codelineno-10-19"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`*.example.com`)</span> </span></code></pre></div> <h4 id="rule">Rule<a class="headerlink" href="#rule" title="Permanent link">¶</a></h4> <p>Currently supported rules are</p> <table> <thead> <tr> <th>Rule</th> <th>Description</th> <th>Example</th> </tr> </thead> <tbody> <tr> <td><code>Host(`domain`)</code></td> <td>The host for HTTP requests or SNI for TLS requests match <code>domain</code>, equivalent to <code>filter.host</code>.</td> <td><code>Host(`example.com`)</code>,<code>Host(`*.example.org`)</code></td> </tr> <tr> <td><code>HostRegexp(`regexp`)</code></td> <td>The host for HTTP requests or SNI for TLS requests match the regular expression <code>regexp</code>.</td> <td><code>HostRegexp(`^.+\.example\.com$`)</code></td> </tr> <tr> <td><code>Method(`method`)</code></td> <td>The method for HTTP requests match <code>method</code>.</td> <td><code>Method(`POST`)</code></td> </tr> <tr> <td><code>Path(`path`)</code></td> <td>The path for HTTP requests match <code>path</code>.</td> <td><code>Path(`/products/1234`)</code></td> </tr> <tr> <td><code>PathPrefix(`prefix`)</code></td> <td>The path for HTTP requests match the prefix <code>prefix</code>, equivalent to <code>filter.path</code>.</td> <td><code>PathPrefix(`/products`)</code></td> </tr> <tr> <td><code>PathRegexp(`regexp`)</code></td> <td>The path for HTTP requests match the regular expression <code>regexp</code>.</td> <td><code>PathRegexp(`\.(jpeg|jpg|png)$`)</code></td> </tr> <tr> <td><code>Query(`key`)</code></td> <td>The query parameters for HTTP requests contain <code>key</code></td> <td><code>Query(`foo``)</code></td> </tr> <tr> <td><code>Query(`key`, `value`)</code></td> <td>The query parameters for HTTP requests contain <code>key</code>, and the corresponding value match <code>value</code>.</td> <td><code>Query(`foo`, `bar`)</code></td> </tr> <tr> <td><code>QueryRegexp(`key`, `regexp`)</code></td> <td>The query parameters for HTTP requests contain <code>key</code>, and the corresponding value match the regular expression <code>regexp</code>.</td> <td><code>QueryRegexp(`foo`, `^.*$`)</code></td> </tr> <tr> <td><code>Header(`key`)</code></td> <td>The header for HTTP requests contain <code>key</code>.</td> <td><code>Header(`Content-Type`)</code></td> </tr> <tr> <td><code>Header(`key`, `value`)</code></td> <td>The header for HTTP requests contain <code>key</code>, and the corresponding value match <code>value</code>.</td> <td><code>Header(`Content-Type`, `application/json`)</code></td> </tr> <tr> <td><code>HeaderRegexp(`key`, `regexp`)</code></td> <td>The header for HTTP requests contain <code>key</code>, and the corresponding value match the regular expression <code>regexp</code>.</td> <td><code>HeaderRegexp(`Content-Type`, `^application/(json|yaml)$`)</code></td> </tr> <tr> <td><code>ClientIP(`ip`)</code></td> <td>The requests client IP match <code>ip</code>. The format of <code>ip</code> is IPv4, IPv6 or CIDR.</td> <td><code>ClientIP(`192.168.0.1`)</code>,<code>ClientIP(`::1`)</code>,<code>ClientIP(`192.168.1.0/24`)</code>,<code>ClientIP(`fe80::/10`)</code></td> </tr> <tr> <td><code>Proto(`proto`)</code></td> <td>Match the protocol,equivalent to <code>filter.protocol</code>.</td> <td><code>Proto(`http`)</code></td> </tr> </tbody> </table> <div class="admonition important"> <p class="admonition-title">Regexp Syntax</p> <p>Matchers that accept a regexp as their value use a <a href="https://golang.org/pkg/regexp/">Go</a> flavored syntax.</p> </div> <div class="admonition tip"> <p class="admonition-title">Expressing Complex Rules Using Operators and Parenthesis</p> <p>The usual AND (<code>&&</code>) and OR (<code>||</code>) logical operators can be used, with the expected precedence rules, as well as parentheses.</p> <p>One can invert a matcher by using the NOT (<code>!</code>) operator.</p> <p>The following rule matches requests where:</p> <ul> <li>either host is <code>example.com</code> OR,</li> <li>host is <code>example.org</code> AND path is NOT <code>/path</code></li> </ul> <div class="highlight"><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`) || (Host(`example.org`) && !Path(`/path`))</span> </code></pre></div> </div> <h4 id="priority">Priority<a class="headerlink" href="#priority" title="Permanent link">¶</a></h4> <p>To avoid path overlap, routes are sorted, by default, in descending order using rules length. The priority is directly equal to the length of the rule, and so the longest length has the highest priority.</p> <p>The <code>matcher.priority</code> option can be used to set the priority of the node, thereby changing the priority of node selection.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-12-2" name="__codelineno-12-2" href="#__codelineno-12-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-12-3" name="__codelineno-12-3" href="#__codelineno-12-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-12-4" name="__codelineno-12-4" href="#__codelineno-12-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-12-5" name="__codelineno-12-5" href="#__codelineno-12-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-12-6" name="__codelineno-12-6" href="#__codelineno-12-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-12-7" name="__codelineno-12-7" href="#__codelineno-12-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-12-8" name="__codelineno-12-8" href="#__codelineno-12-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-12-9" name="__codelineno-12-9" href="#__codelineno-12-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-12-10" name="__codelineno-12-10" href="#__codelineno-12-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-12-11" name="__codelineno-12-11" href="#__codelineno-12-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-12-12" name="__codelineno-12-12" href="#__codelineno-12-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">target-0</span> <a id="__codelineno-12-13" name="__codelineno-12-13" href="#__codelineno-12-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.1:80</span> <a id="__codelineno-12-14" name="__codelineno-12-14" href="#__codelineno-12-14"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-12-15" name="__codelineno-12-15" href="#__codelineno-12-15"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`www.example.com`)</span> <a id="__codelineno-12-16" name="__codelineno-12-16" href="#__codelineno-12-16"></a><span class="hll"><span class="w"> </span><span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span> </span><a id="__codelineno-12-17" name="__codelineno-12-17" href="#__codelineno-12-17"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">target-1</span> <a id="__codelineno-12-18" name="__codelineno-12-18" href="#__codelineno-12-18"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.1.2:80</span> <a id="__codelineno-12-19" name="__codelineno-12-19" href="#__codelineno-12-19"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-12-20" name="__codelineno-12-20" href="#__codelineno-12-20"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`*.example.com`)</span> <a id="__codelineno-12-21" name="__codelineno-12-21" href="#__codelineno-12-21"></a><span class="hll"><span class="w"> </span><span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">50</span> </span></code></pre></div> <p>When the requested Host is <code>www.example.com</code>, the <code>target-0</code> node will be selected first.</p> <h2 id="http-request-settings">HTTP Request Settings<a class="headerlink" href="#http-request-settings" title="Permanent link">¶</a></h2> <p>When sniffing HTTP traffic, you can set the HTTP request information on the target node through the <code>forwarder.nodes.http</code> option, including Host header rewriting, custom header information, basic auth, URL path rewriting.</p> <h3 id="rewrite-host-header">Rewrite Host Header<a class="headerlink" href="#rewrite-host-header" title="Permanent link">¶</a></h3> <p>The Host in the original request header can be overridden by setting the <code>http.host</code> option.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-13-1" name="__codelineno-13-1" href="#__codelineno-13-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-13-2" name="__codelineno-13-2" href="#__codelineno-13-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-13-3" name="__codelineno-13-3" href="#__codelineno-13-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-13-4" name="__codelineno-13-4" href="#__codelineno-13-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-13-5" name="__codelineno-13-5" href="#__codelineno-13-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-13-6" name="__codelineno-13-6" href="#__codelineno-13-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-13-7" name="__codelineno-13-7" href="#__codelineno-13-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-13-8" name="__codelineno-13-8" href="#__codelineno-13-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-13-9" name="__codelineno-13-9" href="#__codelineno-13-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-13-10" name="__codelineno-13-10" href="#__codelineno-13-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-13-11" name="__codelineno-13-11" href="#__codelineno-13-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-13-12" name="__codelineno-13-12" href="#__codelineno-13-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-13-13" name="__codelineno-13-13" href="#__codelineno-13-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-13-14" name="__codelineno-13-14" href="#__codelineno-13-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-13-15" name="__codelineno-13-15" href="#__codelineno-13-15"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-13-16" name="__codelineno-13-16" href="#__codelineno-13-16"></a><span class="hll"><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> </span><a id="__codelineno-13-17" name="__codelineno-13-17" href="#__codelineno-13-17"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> </span><a id="__codelineno-13-18" name="__codelineno-13-18" href="#__codelineno-13-18"></a><span class="w"> </span><span class="nt">http</span><span class="p">:</span> <a id="__codelineno-13-19" name="__codelineno-13-19" href="#__codelineno-13-19"></a><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">test.example.com</span> <a id="__codelineno-13-20" name="__codelineno-13-20" href="#__codelineno-13-20"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-org</span> <a id="__codelineno-13-21" name="__codelineno-13-21" href="#__codelineno-13-21"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.org:80</span> <a id="__codelineno-13-22" name="__codelineno-13-22" href="#__codelineno-13-22"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-13-23" name="__codelineno-13-23" href="#__codelineno-13-23"></a><span class="w"> </span><span class="c1"># host: example.org</span> <a id="__codelineno-13-24" name="__codelineno-13-24" href="#__codelineno-13-24"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-13-25" name="__codelineno-13-25" href="#__codelineno-13-25"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.org`)</span> <a id="__codelineno-13-26" name="__codelineno-13-26" href="#__codelineno-13-26"></a><span class="w"> </span><span class="nt">http</span><span class="p">:</span> <a id="__codelineno-13-27" name="__codelineno-13-27" href="#__codelineno-13-27"></a><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">test.example.org:80</span> </code></pre></div> <div class="highlight"><pre><span></span><code><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a>curl<span class="w"> </span>--resolve<span class="w"> </span>example.com:80:127.0.0.1<span class="w"> </span>http://example.com </code></pre></div> <p>When requesting http://example.com, the Host in the HTTP request header sent to example.com:80 is test.example.com.</p> <h3 id="custom-request-header">Custom Request Header<a class="headerlink" href="#custom-request-header" title="Permanent link">¶</a></h3> <p>The request header can be customized by setting the <code>http.requestHeader</code> option, if the header field already exists, it will be overwritten.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-15-2" name="__codelineno-15-2" href="#__codelineno-15-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-15-3" name="__codelineno-15-3" href="#__codelineno-15-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-15-4" name="__codelineno-15-4" href="#__codelineno-15-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-15-5" name="__codelineno-15-5" href="#__codelineno-15-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-15-6" name="__codelineno-15-6" href="#__codelineno-15-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-15-7" name="__codelineno-15-7" href="#__codelineno-15-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-15-8" name="__codelineno-15-8" href="#__codelineno-15-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-15-9" name="__codelineno-15-9" href="#__codelineno-15-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-15-10" name="__codelineno-15-10" href="#__codelineno-15-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-15-11" name="__codelineno-15-11" href="#__codelineno-15-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-15-12" name="__codelineno-15-12" href="#__codelineno-15-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-15-13" name="__codelineno-15-13" href="#__codelineno-15-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-15-14" name="__codelineno-15-14" href="#__codelineno-15-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-15-15" name="__codelineno-15-15" href="#__codelineno-15-15"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-15-16" name="__codelineno-15-16" href="#__codelineno-15-16"></a><span class="hll"><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> </span><a id="__codelineno-15-17" name="__codelineno-15-17" href="#__codelineno-15-17"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> </span><a id="__codelineno-15-18" name="__codelineno-15-18" href="#__codelineno-15-18"></a><span class="hll"><span class="w"> </span><span class="nt">http</span><span class="p">:</span> </span><a id="__codelineno-15-19" name="__codelineno-15-19" href="#__codelineno-15-19"></a><span class="hll"><span class="w"> </span><span class="nt">requestHeader</span><span class="p">:</span> </span><a id="__codelineno-15-20" name="__codelineno-15-20" href="#__codelineno-15-20"></a><span class="hll"><span class="w"> </span><span class="nt">User-Agent</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">gost/3.0.0</span> </span><a id="__codelineno-15-21" name="__codelineno-15-21" href="#__codelineno-15-21"></a><span class="w"> </span><span class="nt">foo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">bar</span> <a id="__codelineno-15-22" name="__codelineno-15-22" href="#__codelineno-15-22"></a><span class="w"> </span><span class="nt">bar</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">123</span> <a id="__codelineno-15-23" name="__codelineno-15-23" href="#__codelineno-15-23"></a><span class="w"> </span><span class="c1"># host: test.example.com</span> <a id="__codelineno-15-24" name="__codelineno-15-24" href="#__codelineno-15-24"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-org</span> <a id="__codelineno-15-25" name="__codelineno-15-25" href="#__codelineno-15-25"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.org:80</span> <a id="__codelineno-15-26" name="__codelineno-15-26" href="#__codelineno-15-26"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-15-27" name="__codelineno-15-27" href="#__codelineno-15-27"></a><span class="w"> </span><span class="c1"># host: example.org</span> <a id="__codelineno-15-28" name="__codelineno-15-28" href="#__codelineno-15-28"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-15-29" name="__codelineno-15-29" href="#__codelineno-15-29"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.org`)</span> <a id="__codelineno-15-30" name="__codelineno-15-30" href="#__codelineno-15-30"></a><span class="w"> </span><span class="nt">http</span><span class="p">:</span> <a id="__codelineno-15-31" name="__codelineno-15-31" href="#__codelineno-15-31"></a><span class="w"> </span><span class="nt">requestHeader</span><span class="p">:</span> <a id="__codelineno-15-32" name="__codelineno-15-32" href="#__codelineno-15-32"></a><span class="w"> </span><span class="nt">User-Agent</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">curl/7.81.0</span> <a id="__codelineno-15-33" name="__codelineno-15-33" href="#__codelineno-15-33"></a><span class="w"> </span><span class="nt">foo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">bar</span> <a id="__codelineno-15-34" name="__codelineno-15-34" href="#__codelineno-15-34"></a><span class="w"> </span><span class="nt">bar</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">baz</span> <a id="__codelineno-15-35" name="__codelineno-15-35" href="#__codelineno-15-35"></a><span class="w"> </span><span class="c1"># host: test.example.org:80</span> </code></pre></div> <p>When requesting http://example.com, three fields <code>User-Agent</code>, <code>Foo</code> and <code>Bar</code> will be added to the HTTP request header sent to example.com:80.</p> <h3 id="custom-response-header">Custom Response Header<a class="headerlink" href="#custom-response-header" title="Permanent link">¶</a></h3> <p>The response header can be customized by setting the <code>http.responseHeader</code> option, if the header field already exists, it will be overwritten.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-16-1" name="__codelineno-16-1" href="#__codelineno-16-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-16-2" name="__codelineno-16-2" href="#__codelineno-16-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-16-3" name="__codelineno-16-3" href="#__codelineno-16-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-16-4" name="__codelineno-16-4" href="#__codelineno-16-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-16-5" name="__codelineno-16-5" href="#__codelineno-16-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-16-6" name="__codelineno-16-6" href="#__codelineno-16-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-16-7" name="__codelineno-16-7" href="#__codelineno-16-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-16-8" name="__codelineno-16-8" href="#__codelineno-16-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-16-9" name="__codelineno-16-9" href="#__codelineno-16-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-16-10" name="__codelineno-16-10" href="#__codelineno-16-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-16-11" name="__codelineno-16-11" href="#__codelineno-16-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-16-12" name="__codelineno-16-12" href="#__codelineno-16-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-16-13" name="__codelineno-16-13" href="#__codelineno-16-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-16-14" name="__codelineno-16-14" href="#__codelineno-16-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-16-15" name="__codelineno-16-15" href="#__codelineno-16-15"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-16-16" name="__codelineno-16-16" href="#__codelineno-16-16"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-16-17" name="__codelineno-16-17" href="#__codelineno-16-17"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> </span><a id="__codelineno-16-18" name="__codelineno-16-18" href="#__codelineno-16-18"></a><span class="hll"><span class="w"> </span><span class="nt">http</span><span class="p">:</span> </span><a id="__codelineno-16-19" name="__codelineno-16-19" href="#__codelineno-16-19"></a><span class="hll"><span class="w"> </span><span class="nt">responseHeader</span><span class="p">:</span> </span><a id="__codelineno-16-20" name="__codelineno-16-20" href="#__codelineno-16-20"></a><span class="w"> </span><span class="nt">foo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">bar</span> <a id="__codelineno-16-21" name="__codelineno-16-21" href="#__codelineno-16-21"></a><span class="w"> </span><span class="nt">bar</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">123</span> </code></pre></div> <p>When requesting http://example.com, <code>Foo</code> and <code>Bar</code> fields will be added to the HTTP response header received from example.com:80.</p> <h3 id="http-basic-authentication">HTTP Basic Authentication<a class="headerlink" href="#http-basic-authentication" title="Permanent link">¶</a></h3> <p>You can enable <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">HTTP Basic Authentication</a> for target node by setting the <code>http.auth</code> option.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-17-2" name="__codelineno-17-2" href="#__codelineno-17-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-17-3" name="__codelineno-17-3" href="#__codelineno-17-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-17-4" name="__codelineno-17-4" href="#__codelineno-17-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-17-5" name="__codelineno-17-5" href="#__codelineno-17-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-17-6" name="__codelineno-17-6" href="#__codelineno-17-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-17-7" name="__codelineno-17-7" href="#__codelineno-17-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-17-8" name="__codelineno-17-8" href="#__codelineno-17-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-17-9" name="__codelineno-17-9" href="#__codelineno-17-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-17-10" name="__codelineno-17-10" href="#__codelineno-17-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-17-11" name="__codelineno-17-11" href="#__codelineno-17-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-17-12" name="__codelineno-17-12" href="#__codelineno-17-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-17-13" name="__codelineno-17-13" href="#__codelineno-17-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-17-14" name="__codelineno-17-14" href="#__codelineno-17-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-17-15" name="__codelineno-17-15" href="#__codelineno-17-15"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-17-16" name="__codelineno-17-16" href="#__codelineno-17-16"></a><span class="hll"><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> </span><a id="__codelineno-17-17" name="__codelineno-17-17" href="#__codelineno-17-17"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> </span><a id="__codelineno-17-18" name="__codelineno-17-18" href="#__codelineno-17-18"></a><span class="hll"><span class="w"> </span><span class="nt">http</span><span class="p">:</span> </span><a id="__codelineno-17-19" name="__codelineno-17-19" href="#__codelineno-17-19"></a><span class="hll"><span class="w"> </span><span class="nt">auth</span><span class="p">:</span> </span><a id="__codelineno-17-20" name="__codelineno-17-20" href="#__codelineno-17-20"></a><span class="w"> </span><span class="nt">username</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">user</span> <a id="__codelineno-17-21" name="__codelineno-17-21" href="#__codelineno-17-21"></a><span class="w"> </span><span class="nt">password</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pass</span> </code></pre></div> <p>When requesting http://example.com directly, HTTP status code 401 will be returned to require authentication.</p> <h3 id="rewrite-url-path">Rewrite URL Path<a class="headerlink" href="#rewrite-url-path" title="Permanent link">¶</a></h3> <p>Define URL path rewriting rules by setting the <code>http.rewriteURL</code> option. </p> <div class="highlight"><pre><span></span><code><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-18-2" name="__codelineno-18-2" href="#__codelineno-18-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-18-3" name="__codelineno-18-3" href="#__codelineno-18-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-18-4" name="__codelineno-18-4" href="#__codelineno-18-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-18-5" name="__codelineno-18-5" href="#__codelineno-18-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-18-6" name="__codelineno-18-6" href="#__codelineno-18-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-18-7" name="__codelineno-18-7" href="#__codelineno-18-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-18-8" name="__codelineno-18-8" href="#__codelineno-18-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-18-9" name="__codelineno-18-9" href="#__codelineno-18-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-18-10" name="__codelineno-18-10" href="#__codelineno-18-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-18-11" name="__codelineno-18-11" href="#__codelineno-18-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-18-12" name="__codelineno-18-12" href="#__codelineno-18-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-18-13" name="__codelineno-18-13" href="#__codelineno-18-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-18-14" name="__codelineno-18-14" href="#__codelineno-18-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-18-15" name="__codelineno-18-15" href="#__codelineno-18-15"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-18-16" name="__codelineno-18-16" href="#__codelineno-18-16"></a><span class="hll"><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> </span><a id="__codelineno-18-17" name="__codelineno-18-17" href="#__codelineno-18-17"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> </span><a id="__codelineno-18-18" name="__codelineno-18-18" href="#__codelineno-18-18"></a><span class="hll"><span class="w"> </span><span class="nt">http</span><span class="p">:</span> </span><a id="__codelineno-18-19" name="__codelineno-18-19" href="#__codelineno-18-19"></a><span class="hll"><span class="w"> </span><span class="nt">rewriteURL</span><span class="p">:</span> </span><a id="__codelineno-18-20" name="__codelineno-18-20" href="#__codelineno-18-20"></a><span class="hll"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">match</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/api/login</span> </span><a id="__codelineno-18-21" name="__codelineno-18-21" href="#__codelineno-18-21"></a><span class="hll"><span class="w"> </span><span class="nt">replacement</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/user/login</span> </span><a id="__codelineno-18-22" name="__codelineno-18-22" href="#__codelineno-18-22"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">match</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/api/(.*)</span> <a id="__codelineno-18-23" name="__codelineno-18-23" href="#__codelineno-18-23"></a><span class="w"> </span><span class="nt">replacement</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/$1</span> </code></pre></div> <dl> <dt><code>rewriteURL.match</code> (string)</dt> <dd>specify path matching pattern (supports regular expression).</dd> <dt><code>rewriteURL.replacement</code> (string)</dt> <dd>set the path replacement content.</dd> </dl> <p><code>http://example.com/api/login</code> will be rewritten to <code>http://example.com/user/login</code>.</p> <p><code>http://example.com/api/logout</code> will be rewritten to <code>http://example.com/logout</code>.</p> <h3 id="rewrite-response-body">Rewrite Response Body<a class="headerlink" href="#rewrite-response-body" title="Permanent link">¶</a></h3> <p>Define the response body rewriting rules by setting the <code>http.rewriteBody</code> option.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-19-1" name="__codelineno-19-1" href="#__codelineno-19-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-19-2" name="__codelineno-19-2" href="#__codelineno-19-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-19-3" name="__codelineno-19-3" href="#__codelineno-19-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-19-4" name="__codelineno-19-4" href="#__codelineno-19-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-19-5" name="__codelineno-19-5" href="#__codelineno-19-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-19-6" name="__codelineno-19-6" href="#__codelineno-19-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-19-7" name="__codelineno-19-7" href="#__codelineno-19-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-19-8" name="__codelineno-19-8" href="#__codelineno-19-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-19-9" name="__codelineno-19-9" href="#__codelineno-19-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-19-10" name="__codelineno-19-10" href="#__codelineno-19-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-19-11" name="__codelineno-19-11" href="#__codelineno-19-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-19-12" name="__codelineno-19-12" href="#__codelineno-19-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-19-13" name="__codelineno-19-13" href="#__codelineno-19-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-19-14" name="__codelineno-19-14" href="#__codelineno-19-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-19-15" name="__codelineno-19-15" href="#__codelineno-19-15"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-19-16" name="__codelineno-19-16" href="#__codelineno-19-16"></a><span class="hll"><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> </span><a id="__codelineno-19-17" name="__codelineno-19-17" href="#__codelineno-19-17"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> </span><a id="__codelineno-19-18" name="__codelineno-19-18" href="#__codelineno-19-18"></a><span class="hll"><span class="w"> </span><span class="nt">http</span><span class="p">:</span> </span><a id="__codelineno-19-19" name="__codelineno-19-19" href="#__codelineno-19-19"></a><span class="hll"><span class="w"> </span><span class="nt">rewriteBody</span><span class="p">:</span> </span><a id="__codelineno-19-20" name="__codelineno-19-20" href="#__codelineno-19-20"></a><span class="hll"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">match</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">foo</span> </span><a id="__codelineno-19-21" name="__codelineno-19-21" href="#__codelineno-19-21"></a><span class="w"> </span><span class="nt">replacement</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">bar</span> <a id="__codelineno-19-22" name="__codelineno-19-22" href="#__codelineno-19-22"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">text/html</span> </code></pre></div> <dl> <dt><code>rewriteBody.match</code> (string)</dt> <dd>Specify content matching pattern (regular expressions are supported).</dd> <dt><code>rewriteBody.replacement</code> (string)</dt> <dd>Set the replacement content.</dd> <dt><code>rewriteBody.type</code> (string, default=text/html)</dt> <dd>Set the content type of the response, matching the <code>Content-Type</code> header. It can be multiple types separated by <code>,</code> or <code>*</code> to match all types.</dd> </dl> <h2 id="tls-settings">TLS Settings<a class="headerlink" href="#tls-settings" title="Permanent link">¶</a></h2> <p>If the forwarding target node has TLS enabled, you can establish a TLS connection by setting <code>forwarder.nodes.tls</code>.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-20-1" name="__codelineno-20-1" href="#__codelineno-20-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-20-2" name="__codelineno-20-2" href="#__codelineno-20-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http</span> <a id="__codelineno-20-3" name="__codelineno-20-3" href="#__codelineno-20-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:80</span> <a id="__codelineno-20-4" name="__codelineno-20-4" href="#__codelineno-20-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-20-5" name="__codelineno-20-5" href="#__codelineno-20-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-20-6" name="__codelineno-20-6" href="#__codelineno-20-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-20-7" name="__codelineno-20-7" href="#__codelineno-20-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-20-8" name="__codelineno-20-8" href="#__codelineno-20-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-20-9" name="__codelineno-20-9" href="#__codelineno-20-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tcp</span> <a id="__codelineno-20-10" name="__codelineno-20-10" href="#__codelineno-20-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-20-11" name="__codelineno-20-11" href="#__codelineno-20-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-20-12" name="__codelineno-20-12" href="#__codelineno-20-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-20-13" name="__codelineno-20-13" href="#__codelineno-20-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:443</span> <a id="__codelineno-20-14" name="__codelineno-20-14" href="#__codelineno-20-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-20-15" name="__codelineno-20-15" href="#__codelineno-20-15"></a><span class="w"> </span><span class="c1"># host: example.com</span> <a id="__codelineno-20-16" name="__codelineno-20-16" href="#__codelineno-20-16"></a><span class="hll"><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> </span><a id="__codelineno-20-17" name="__codelineno-20-17" href="#__codelineno-20-17"></a><span class="hll"><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`example.com`)</span> </span><a id="__codelineno-20-18" name="__codelineno-20-18" href="#__codelineno-20-18"></a><span class="hll"><span class="w"> </span><span class="nt">tls</span><span class="p">:</span> </span><a id="__codelineno-20-19" name="__codelineno-20-19" href="#__codelineno-20-19"></a><span class="hll"><span class="w"> </span><span class="nt">secure</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> </span><a id="__codelineno-20-20" name="__codelineno-20-20" href="#__codelineno-20-20"></a><span class="hll"><span class="w"> </span><span class="nt">serverName</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com</span> </span><a id="__codelineno-20-21" name="__codelineno-20-21" href="#__codelineno-20-21"></a><span class="hll"><span class="w"> </span><span class="nt">options</span><span class="p">:</span> </span><a id="__codelineno-20-22" name="__codelineno-20-22" href="#__codelineno-20-22"></a><span class="hll"><span class="w"> </span><span class="nt">minVersion</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">VersionTLS12</span> </span><a id="__codelineno-20-23" name="__codelineno-20-23" href="#__codelineno-20-23"></a><span class="hll"><span class="w"> </span><span class="nt">maxVersion</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">VersionTLS13</span> </span><a id="__codelineno-20-24" name="__codelineno-20-24" href="#__codelineno-20-24"></a><span class="w"> </span><span class="nt">cipherSuites</span><span class="p">:</span> <a id="__codelineno-20-25" name="__codelineno-20-25" href="#__codelineno-20-25"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256</span> </code></pre></div> <dl> <dt><code>tls.secure</code> (bool, default=false)</dt> <dd>Whether to enable server certificate and domain name verification.</dd> <dt><code>tls.serverName</code> (string)</dt> <dd>If <code>secure</code> is set to true, you need to specify the server domain name for domain name verification through this parameter.</dd> <dt><code>tls.options.minVersion</code> (string)</dt> <dd>Minimum TLS Version, <code>VersionTLS10</code>, <code>VersionTLS11</code>, <code>VersionTLS12</code> or <code>VersionTLS13</code>.</dd> <dt><code>tls.options.maxVersion</code> (string)</dt> <dd>Maximum TLS Version, <code>VersionTLS10</code>, <code>VersionTLS11</code>, <code>VersionTLS12</code> or <code>VersionTLS13</code>.</dd> <dt><code>tls.options.cipherSuites</code> (list)</dt> <dd>Cipher Suites, See <a href="https://pkg.go.dev/crypto/tls#pkg-constants">Cipher Suites</a> for more information.</dd> </dl> <h2 id="forwarding-tunnel">Forwarding Tunnel<a class="headerlink" href="#forwarding-tunnel" title="Permanent link">¶</a></h2> <p>In addition to the original TCP data tunnel can be used as port forwarding, other tunnels can also be used as port forwarding services.</p> <h3 id="tls">TLS<a class="headerlink" href="#tls" title="Permanent link">¶</a></h3> <p>HTTPS-to-HTTP</p> <p>The TLS forwarding tunnel can dynamically add TLS support to the backend HTTP service.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-21-1" name="__codelineno-21-1" href="#__codelineno-21-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-21-2" name="__codelineno-21-2" href="#__codelineno-21-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https</span> <a id="__codelineno-21-3" name="__codelineno-21-3" href="#__codelineno-21-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:443</span> <a id="__codelineno-21-4" name="__codelineno-21-4" href="#__codelineno-21-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-21-5" name="__codelineno-21-5" href="#__codelineno-21-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">forward</span> <a id="__codelineno-21-6" name="__codelineno-21-6" href="#__codelineno-21-6"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span> <a id="__codelineno-21-7" name="__codelineno-21-7" href="#__codelineno-21-7"></a><span class="w"> </span><span class="nt">sniffing</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span> <a id="__codelineno-21-8" name="__codelineno-21-8" href="#__codelineno-21-8"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-21-9" name="__codelineno-21-9" href="#__codelineno-21-9"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tls</span> <a id="__codelineno-21-10" name="__codelineno-21-10" href="#__codelineno-21-10"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-21-11" name="__codelineno-21-11" href="#__codelineno-21-11"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-21-12" name="__codelineno-21-12" href="#__codelineno-21-12"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-21-13" name="__codelineno-21-13" href="#__codelineno-21-13"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-21-14" name="__codelineno-21-14" href="#__codelineno-21-14"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-21-15" name="__codelineno-21-15" href="#__codelineno-21-15"></a><span class="w"> </span><span class="c1"># host: .example.com</span> <a id="__codelineno-21-16" name="__codelineno-21-16" href="#__codelineno-21-16"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-21-17" name="__codelineno-21-17" href="#__codelineno-21-17"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`.example.com`)</span> <a id="__codelineno-21-18" name="__codelineno-21-18" href="#__codelineno-21-18"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-org</span> <a id="__codelineno-21-19" name="__codelineno-21-19" href="#__codelineno-21-19"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.org:80</span> <a id="__codelineno-21-20" name="__codelineno-21-20" href="#__codelineno-21-20"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-21-21" name="__codelineno-21-21" href="#__codelineno-21-21"></a><span class="w"> </span><span class="c1"># host: .example.org</span> <a id="__codelineno-21-22" name="__codelineno-21-22" href="#__codelineno-21-22"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-21-23" name="__codelineno-21-23" href="#__codelineno-21-23"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`.example.org`)</span> </code></pre></div> <div class="highlight"><pre><span></span><code><a id="__codelineno-22-1" name="__codelineno-22-1" href="#__codelineno-22-1"></a>curl<span class="w"> </span>-k<span class="w"> </span>--resolve<span class="w"> </span>example.com:443:127.0.0.1<span class="w"> </span>https://example.com </code></pre></div> <h3 id="http3">HTTP3<a class="headerlink" href="#http3" title="Permanent link">¶</a></h3> <p>HTTP3-to-HTTP.</p> <p>The HTTP3 forwarding tunnel can dynamically add HTTP/3 support to the backend HTTP service.</p> <div class="highlight"><pre><span></span><code><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a><span class="nt">services</span><span class="p">:</span> <a id="__codelineno-23-2" name="__codelineno-23-2" href="#__codelineno-23-2"></a><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http3</span> <a id="__codelineno-23-3" name="__codelineno-23-3" href="#__codelineno-23-3"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">:443</span> <a id="__codelineno-23-4" name="__codelineno-23-4" href="#__codelineno-23-4"></a><span class="w"> </span><span class="nt">handler</span><span class="p">:</span> <a id="__codelineno-23-5" name="__codelineno-23-5" href="#__codelineno-23-5"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http3</span> <a id="__codelineno-23-6" name="__codelineno-23-6" href="#__codelineno-23-6"></a><span class="w"> </span><span class="nt">listener</span><span class="p">:</span> <a id="__codelineno-23-7" name="__codelineno-23-7" href="#__codelineno-23-7"></a><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http3</span> <a id="__codelineno-23-8" name="__codelineno-23-8" href="#__codelineno-23-8"></a><span class="w"> </span><span class="nt">forwarder</span><span class="p">:</span> <a id="__codelineno-23-9" name="__codelineno-23-9" href="#__codelineno-23-9"></a><span class="w"> </span><span class="nt">nodes</span><span class="p">:</span> <a id="__codelineno-23-10" name="__codelineno-23-10" href="#__codelineno-23-10"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-com</span> <a id="__codelineno-23-11" name="__codelineno-23-11" href="#__codelineno-23-11"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.com:80</span> <a id="__codelineno-23-12" name="__codelineno-23-12" href="#__codelineno-23-12"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-23-13" name="__codelineno-23-13" href="#__codelineno-23-13"></a><span class="w"> </span><span class="c1"># host: .example.com</span> <a id="__codelineno-23-14" name="__codelineno-23-14" href="#__codelineno-23-14"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-23-15" name="__codelineno-23-15" href="#__codelineno-23-15"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`.example.com`)</span> <a id="__codelineno-23-16" name="__codelineno-23-16" href="#__codelineno-23-16"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-org</span> <a id="__codelineno-23-17" name="__codelineno-23-17" href="#__codelineno-23-17"></a><span class="w"> </span><span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example.org:80</span> <a id="__codelineno-23-18" name="__codelineno-23-18" href="#__codelineno-23-18"></a><span class="w"> </span><span class="c1"># filter:</span> <a id="__codelineno-23-19" name="__codelineno-23-19" href="#__codelineno-23-19"></a><span class="w"> </span><span class="c1"># host: .example.org</span> <a id="__codelineno-23-20" name="__codelineno-23-20" href="#__codelineno-23-20"></a><span class="w"> </span><span class="nt">matcher</span><span class="p">:</span> <a id="__codelineno-23-21" name="__codelineno-23-21" href="#__codelineno-23-21"></a><span class="w"> </span><span class="nt">rule</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Host(`.example.org`)</span> </code></pre></div> <div class="highlight"><pre><span></span><code><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a>curl<span class="w"> </span>-k<span class="w"> </span>--http3<span class="w"> </span>--resolve<span class="w"> </span>example.com:443:127.0.0.1<span class="w"> </span>https://example.com </code></pre></div> <h2 id="__comments">Comments</h2> <script src="https://giscus.app/client.js" data-repo="go-gost/gost" data-repo-id="MDEwOlJlcG9zaXRvcnkyNDAwMzk3Njk=" data-category="General" data-category-id="DIC_kwDODk63Wc4CbZTO" data-mapping="pathname" data-strict="0" data-reactions-enabled="1" data-emit-metadata="0" data-input-position="bottom" data-theme="preferred_color_scheme" data-lang="en" data-loading="lazy" crossorigin="anonymous" async> </script> <!-- Synchronize Giscus theme with palette --> <script> var giscus = document.querySelector("script[src*=giscus]") // Set palette on initial load var palette = __md_get("__palette") if (palette && typeof palette.color === "object") { var theme = palette.color.scheme === "slate" ? "transparent_dark" : "light" // Instruct Giscus to set theme giscus.setAttribute("data-theme", theme) } // Register event handlers after documented loaded document.addEventListener("DOMContentLoaded", function() { var ref = document.querySelector("[data-md-component=palette]") ref.addEventListener("change", function() { var palette = __md_get("__palette") if (palette && typeof palette.color === "object") { var theme = palette.color.scheme === "slate" ? "transparent_dark" : "light" // Instruct Giscus to change theme var frame = document.querySelector(".giscus-frame") frame.contentWindow.postMessage( { giscus: { setConfig: { theme } } }, "https://giscus.app" ) } }) }) </script> </article> </div> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> </main> <footer class="md-footer"> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-copyright"> <div class="md-copyright__highlight"> Copyright © 2015 - 2024 GOST </div> Made with <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> Material for MkDocs </a> </div> <div class="md-social"> <a href="https://github.com/go-gost/gost" target="_blank" rel="noopener" title="github.com" class="md-social__link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg> </a> <a href="https://hub.docker.com/r/gogost/gost" target="_blank" rel="noopener" title="hub.docker.com" class="md-social__link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M349.9 236.3h-66.1v-59.4h66.1v59.4zm0-204.3h-66.1v60.7h66.1V32zm78.2 144.8H362v59.4h66.1v-59.4zm-156.3-72.1h-66.1v60.1h66.1v-60.1zm78.1 0h-66.1v60.1h66.1v-60.1zm276.8 100c-14.4-9.7-47.6-13.2-73.1-8.4-3.3-24-16.7-44.9-41.1-63.7l-14-9.3-9.3 14c-18.4 27.8-23.4 73.6-3.7 103.8-8.7 4.7-25.8 11.1-48.4 10.7H2.4c-8.7 50.8 5.8 116.8 44 162.1 37.1 43.9 92.7 66.2 165.4 66.2 157.4 0 273.9-72.5 328.4-204.2 21.4.4 67.6.1 91.3-45.2 1.5-2.5 6.6-13.2 8.5-17.1l-13.3-8.9zm-511.1-27.9h-66v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm-78.1-72.1h-66.1v60.1h66.1v-60.1z"/></svg> </a> <a href="https://t.me/gogost" target="_blank" rel="noopener" title="t.me" class="md-social__link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M248 8C111.033 8 0 119.033 0 256s111.033 248 248 248 248-111.033 248-248S384.967 8 248 8Zm114.952 168.66c-3.732 39.215-19.881 134.378-28.1 178.3-3.476 18.584-10.322 24.816-16.948 25.425-14.4 1.326-25.338-9.517-39.287-18.661-21.827-14.308-34.158-23.215-55.346-37.177-24.485-16.135-8.612-25 5.342-39.5 3.652-3.793 67.107-61.51 68.335-66.746.153-.655.3-3.1-1.154-4.384s-3.59-.849-5.135-.5q-3.283.746-104.608 69.142-14.845 10.194-26.894 9.934c-8.855-.191-25.888-5.006-38.551-9.123-15.531-5.048-27.875-7.717-26.8-16.291q.84-6.7 18.45-13.7 108.446-47.248 144.628-62.3c68.872-28.647 83.183-33.623 92.511-33.789 2.052-.034 6.639.474 9.61 2.885a10.452 10.452 0 0 1 3.53 6.716 43.765 43.765 0 0 1 .417 9.769Z"/></svg> </a> </div> </div> </div> </footer> </div> <div class="md-dialog" data-md-component="dialog"> <div class="md-dialog__inner md-typeset"></div> </div> <script id="__config" type="application/json">{"base": "../..", "features": ["navigation.instant", "navigation.indexes", "header.autohide"], "search": "../../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script> <script src="../../assets/javascripts/bundle.471ce7a9.min.js"></script> </body> </html>