CINXE.COM

<!doctype html> <html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-tls/index" data-has-hydrated="false"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v3.5.2"> <title data-rh="true">Overview | ngrok documentation</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://ngrok.com/docs/img/ngrok-docs-opengraph.png"><meta data-rh="true" name="twitter:image" content="https://ngrok.com/docs/img/ngrok-docs-opengraph.png"><meta data-rh="true" property="og:url" content="https://ngrok.com/docs/tls/"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="keywords" content="ngrok, documentation, api, errors, reference, getting started, tutorials"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Overview | ngrok documentation"><meta data-rh="true" name="description" content="Overview"><meta data-rh="true" property="og:description" content="Overview"><link data-rh="true" rel="icon" href="/docs/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://ngrok.com/docs/tls/"><link data-rh="true" rel="alternate" href="https://ngrok.com/docs/tls/" hreflang="en"><link data-rh="true" rel="alternate" href="https://ngrok.com/docs/tls/" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://8D7MHVMLBR-dsn.algolia.net" crossorigin="anonymous"><link rel="preconnect" href="https://www.googletagmanager.com"> <script>window.dataLayer=window.dataLayer||[]</script> <script>!function(e,t,a,n){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var g=t.getElementsByTagName(a)[0],m=t.createElement(a);m.async=!0,m.src="https://www.googletagmanager.com/gtm.js?id=GTM-P4F37ZW",g.parentNode.insertBefore(m,g)}(window,document,"script","dataLayer")</script> <script id="hs-script-loader" src="//js.hs-scripts.com/21124867.js"></script> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-Regular-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-RegularItalic-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-Medium-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-Semibold-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-MediumItalic-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-Text.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-TextItalic.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-SemiBold.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-SemiBoldItalic.woff" as="font" type="font/woff" crossorigin="anonymous"> <script src="/docs/scripts/ketch.js"></script> <script src="https://global.ketchcdn.com/web/v2/config/ngrok/ngrok_ketch_tag/boot.js" async defer="defer"></script> <script src="/docs/scripts/fix-redirect.js" async></script> <script src="/docs/scripts/anchor-scroll-to.js" async></script> <script src="https://tag.clearbitscripts.com/v1/pk_1caf9e9fb3222466245fb17c8f807837/tags.js"></script><link rel="stylesheet" href="/docs/assets/css/styles.13d6ab4e.css"> <script src="/docs/assets/js/runtime~main.36fd4022.js" defer="defer"></script> <script src="/docs/assets/js/main.94660bb2.js" defer="defer"></script> </head> <body class="navigation-with-keyboard"> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P4F37ZW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_IipK" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a href="https://ngrok.com" target="_blank" rel="noopener noreferrer" class="navbar__brand"><div class="navbar__logo"><img src="/docs/img/ngrok-black.svg" alt="ngrok" class="themedComponent_Az_r themedComponent--light_ik9_"><img src="/docs/img/ngrok-white.svg" alt="ngrok" class="themedComponent_Az_r themedComponent--dark_eDvw"></div></a><a href="https://ngrok.com/product/platform" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Platform</a><a href="https://ngrok.com/use-cases" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Use cases</a><a href="https://ngrok.com/blog" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Blog</a><a href="https://ngrok.com/resources" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Resources</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/">Docs</a><a href="https://ngrok.com/pricing" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Pricing</a><a href="https://download.ngrok.com" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Get ngrok</a></div><div class="navbar__items navbar__items--right"><a href="https://dashboard.ngrok.com/login" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link dev-portal-login dev-portal-link">Log in</a><a href="https://ngrok.com/signup" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link dev-portal-signup dev-portal-link">Sign Up</a><div class="toggle_DITL colorModeToggle_bvw4"><button class="clean-btn toggleButton_bazi toggleButtonDisabled_IzIM" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_j6C1"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_uFh4"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_nbxA"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_pOYi"><div class="docsWrapper_kVRX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_OuIh" type="button"></button><div class="docRoot_v94m"><aside class="theme-doc-sidebar-container docSidebarContainer_JlOU"><div class="sidebarViewport_A_zS"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button><div class="sidebar_idex"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_nVoB"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/what-is-ngrok/">What is ngrok?</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/how-ngrok-works/">How does ngrok work?</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/why-ngrok/">Why ngrok?</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/whats-new/">What&#x27;s new?</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/getting-started/">Getting Started</a><button aria-label="Expand sidebar category &#x27;Getting Started&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Endpoints</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/http/">HTTP</a><button aria-label="Expand sidebar category &#x27;HTTP&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" href="/docs/tls/">TLS</a><button aria-label="Collapse sidebar category &#x27;TLS&#x27;" aria-expanded="true" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/tls/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/tls/ip-restrictions/">IP Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/tls/mutual-tls/">Mutual TLS</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/tls/tls-termination/">TLS Termination</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" tabindex="0" href="/docs/tls/traffic-policy/">Traffic Policy</a><button aria-label="Expand sidebar category &#x27;Traffic Policy&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/tcp/">TCP</a><button aria-label="Expand sidebar category &#x27;TCP&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Connectivity</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/agent/">Agent</a><button aria-label="Expand sidebar category &#x27;Agent&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/agent-sdks/">Agent SDKs</a><button aria-label="Expand sidebar category &#x27;Agent SDKs&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/k8s/">Kubernetes</a><button aria-label="Expand sidebar category &#x27;Kubernetes&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Platform</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/network-edge/">Network Edge</a><button aria-label="Expand sidebar category &#x27;Network Edge&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/api/">API</a><button aria-label="Expand sidebar category &#x27;API&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/obs/">Observability</a><button aria-label="Expand sidebar category &#x27;Observability&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/iam/">IAM</a><button aria-label="Expand sidebar category &#x27;IAM&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/errors/">Errors</a><button aria-label="Expand sidebar category &#x27;Errors&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Walkthroughs</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/guides/">Guides</a><button aria-label="Expand sidebar category &#x27;Guides&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/integrations/">Integrations</a><button aria-label="Expand sidebar category &#x27;Integrations&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section"></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/faq/">FAQ</a></li></ul></nav></div></div></aside><main class="docMainContainer_HBBy"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_dNMx"><div class="docItemContainer_iJh1"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_SKcw" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/docs/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_ZMzL"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">TLS</span><meta itemprop="position" content="1"></li></ul></nav><div class="tocCollapsible_AX1Z theme-doc-toc-mobile tocMobile_HCfs"><button type="button" class="clean-btn tocCollapsibleButton_gEwV">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>TLS Endpoints</h1></header> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="overview">Overview<a href="#overview" class="hash-link" aria-label="Direct link to Overview" title="Direct link to Overview">​</a></h2> <p>TLS endpoints enable you to deliver any network service that runs over a TLS-based protocol. TLS endpoints make no assumptions about the wrapped protocol being transported.</p> <p>TLS endpoints use the <a href="#compatible-clients">Server Name Information (SNI)</a> data on incoming TLS connections to route connections to the appropriate endpoint.</p> <p>Because the TLS protocol has limited application-level semantics, ngrok can only offer a <a href="#modules">limited set of modules</a> to handle TLS traffic.</p> <p>You may choose where to terminate TLS, including at your upstream service or at the ngrok agent to achieve end-to-end encryption (E2EE). We call this <a href="/docs/tls/tls-termination/#zero-knowledge-tls">Zero Knowledge TLS</a>. When your TLS endpoints operate in this mode, the ngrok edge can not see the payloads that transfer through your endpoints.</p> <p>If you are delivering an HTTPS application, prefer to create an <a href="/docs/http/">HTTP Endpoint</a>.</p> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="example-usage">Example Usage<a href="#example-usage" class="hash-link" aria-label="Direct link to Example Usage" title="Direct link to Example Usage">​</a></h2> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="terminate-at-edge">Terminate at Edge<a href="#terminate-at-edge" class="hash-link" aria-label="Direct link to Terminate at Edge" title="Direct link to Terminate at Edge">​</a></h3> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">Agent CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Agent Config</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">SSH</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Javascript</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Rust</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Kubernetes Controller</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-bash codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-bash codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">ngrok tls </span><span class="token number" style="color:#36acaa">80</span><span class="token plain"> --terminate-at edge </span><span class="token parameter variable" style="color:#36acaa">--url</span><span class="token plain"> your-name.ngrok.app</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">tunnels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">example</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">proto</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> tls</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">terminate_at</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> edge</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">domain</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> your</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">name.ngrok.app</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">addr</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">80</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>SSH does not support termination at the edge</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-go codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-go codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;context&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;net&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;golang.ngrok.com/ngrok&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;golang.ngrok.com/ngrok/config&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">func</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">ngrokListener</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">ctx context</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">Context</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">net</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">Listener</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token builtin">error</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">return</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">Listen</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">ctx</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">TLSEndpoint</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithDomain</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;your-name.ngrok.app&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithTLSTermination</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithTLSTerminationAt</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">TLSAtEdge</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithAuthtokenFromEnv</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Go Package Docs:</p> <ul> <li><a href="https://pkg.go.dev/golang.ngrok.com/ngrok/config#WithDomain" target="_blank" rel="noopener noreferrer">https://pkg.go.dev/golang.ngrok.com/ngrok/config#WithDomain</a></li> <li><a href="https://pkg.go.dev/golang.ngrok.com/ngrok/config#WithTLSTerminationAt" target="_blank" rel="noopener noreferrer">https://pkg.go.dev/golang.ngrok.com/ngrok/config#WithTLSTerminationAt</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-jsx codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-jsx codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> ngrok </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">require</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;@ngrok/ngrok&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> fs </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">require</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;fs&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">(</span><span class="token keyword" style="color:#00009f">async</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">function</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:#00009f">await</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">addr</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8080</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">authtoken_from_env</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">true</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">proto</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">domain</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;app.example.com&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">crt</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> fs</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">readFileSync</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;/path/to/app-example-com-crt.pem&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;utf8&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">key</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> fs</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">readFileSync</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;/path/to/app-example-com-key.pem&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;utf8&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token console class-name">console</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">log</span><span class="token punctuation" style="color:#393A34">(</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Ingress established at: </span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">listener</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation method function property-access" style="color:#d73a49">url</span><span class="token template-string interpolation punctuation" style="color:#393A34">(</span><span class="token template-string interpolation punctuation" style="color:#393A34">)</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Javascript SDK Docs:</p> <ul> <li> <p><a href="https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#domain" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#domain</a></p> </li> <li> <p><a href="https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#crt" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#crt</a></p> </li> <li> <p><a href="https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#key" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#key</a></p> </li> <li> <p><a href="https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#domain" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#domain</a></p> </li> <li> <p><a href="https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#termination" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#termination</a></p> </li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-python codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-python codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> ngrok</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">def</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">load_file</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">name</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">with</span><span class="token plain"> </span><span class="token builtin">open</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">name</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;r&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">as</span><span class="token plain"> crt</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">return</span><span class="token plain"> </span><span class="token builtin">bytearray</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">crt</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">read</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">encode</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;localhost:8080&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> authtoken_from_env</span><span class="token operator" style="color:#393A34">=</span><span class="token boolean" style="color:#36acaa">True</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> proto</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> domain</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">&quot;app.example.com&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> crt</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">load_file</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;/path/to/app-example-com-crt.pem&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> key</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">load_file</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;/path/to/app-example-com-key.pem&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string-interpolation string" style="color:#e3116c">f&quot;Ingress established at: </span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">{</span><span class="token string-interpolation interpolation">listener</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">.</span><span class="token string-interpolation interpolation">url</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">(</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">)</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">}</span><span class="token string-interpolation string" style="color:#e3116c">&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Python SDK Docs:</p> <ul> <li><a href="https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.domain" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.domain</a></li> <li><a href="https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.termination" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.termination</a></li> <li><a href="https://ngrok.github.io/ngrok-python/index.html#full-configuration" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/index.html#full-configuration</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>The Rust SDK does not support TLS termination at the ngrok edge</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>TLS endpoints are not supported by the ngrok Kubernetes Operator</p></div></div></div></div></div> <br> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="terminate-at-upstream">Terminate at Upstream<a href="#terminate-at-upstream" class="hash-link" aria-label="Direct link to Terminate at Upstream" title="Direct link to Terminate at Upstream">​</a></h3> <p>See <a href="/docs/tls/tls-termination/#zero-knowledge-tls">Zero-Knowledge TLS</a> for additional details.</p> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">Agent CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Agent Config</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">SSH</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Javascript</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Rust</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Kubernetes Controller</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-bash codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-bash codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">ngrok tls </span><span class="token number" style="color:#36acaa">443</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> --terminate-at upstream </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">--url</span><span class="token plain"> app.example.com</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">tunnels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">example</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">proto</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> tls</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">domain</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> app.example.com</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">addr</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">443</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">terminate_at</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> upstream</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-bash codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-bash codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token function" style="color:#d73a49">ssh</span><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">-R</span><span class="token plain"> app.example.com:443:localhost:443 v2@connect.ngrok-agent.com tls</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-go codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-go codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;context&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;net&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;golang.ngrok.com/ngrok&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;golang.ngrok.com/ngrok/config&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">func</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">ngrokListener</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">ctx context</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">Context</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">net</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">Listener</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token builtin">error</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">return</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">Listen</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">ctx</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">TLSEndpoint</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithDomain</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;app.example.com&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithAuthtokenFromEnv</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Go Package Docs:</p> <ul> <li><a href="https://pkg.go.dev/golang.ngrok.com/ngrok/config#TLSEndpoint" target="_blank" rel="noopener noreferrer">https://pkg.go.dev/golang.ngrok.com/ngrok/config#TLSEndpoint</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-jsx codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-jsx codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> ngrok </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">require</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;@ngrok/ngrok&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">(</span><span class="token keyword" style="color:#00009f">async</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">function</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:#00009f">await</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">addr</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8080</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">authtoken_from_env</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">true</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">proto</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">domain</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;app.example.com&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token console class-name">console</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">log</span><span class="token punctuation" style="color:#393A34">(</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Ingress established at: </span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">listener</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation method function property-access" style="color:#d73a49">url</span><span class="token template-string interpolation punctuation" style="color:#393A34">(</span><span class="token template-string interpolation punctuation" style="color:#393A34">)</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Javascript SDK Docs:</p> <ul> <li><a href="https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#domain" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#domain</a></li> <li><a href="https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#domain" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#domain</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-python codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-python codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> ngrok</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;localhost:8080&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> authtoken_from_env</span><span class="token operator" style="color:#393A34">=</span><span class="token boolean" style="color:#36acaa">True</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> proto</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> domain</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">&quot;app.example.com&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string-interpolation string" style="color:#e3116c">f&quot;Ingress established at: </span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">{</span><span class="token string-interpolation interpolation">listener</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">.</span><span class="token string-interpolation interpolation">url</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">(</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">)</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">}</span><span class="token string-interpolation string" style="color:#e3116c">&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Python SDK Docs:</p> <ul> <li><a href="https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.domain" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.domain</a></li> <li><a href="https://ngrok.github.io/ngrok-python/index.html#full-configuration" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/index.html#full-configuration</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-rust codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-rust codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">use</span><span class="token plain"> </span><span class="token namespace" style="opacity:0.7">ngrok</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token namespace" style="opacity:0.7">prelude</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token operator" style="color:#393A34">*</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">async</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">fn</span><span class="token plain"> </span><span class="token function-definition function" style="color:#d73a49">listen_ngrok</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-&gt;</span><span class="token plain"> </span><span class="token namespace" style="opacity:0.7">anyhow</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token class-name">Result</span><span class="token operator" style="color:#393A34">&lt;</span><span class="token keyword" style="color:#00009f">impl</span><span class="token plain"> </span><span class="token class-name">Tunnel</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">let</span><span class="token plain"> sess </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token namespace" style="opacity:0.7">ngrok</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token class-name">Session</span><span class="token punctuation" style="color:#393A34">::</span><span class="token function" style="color:#d73a49">builder</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">authtoken_from_env</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">connect</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token keyword" style="color:#00009f">await</span><span class="token operator" style="color:#393A34">?</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">let</span><span class="token plain"> tun </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> sess</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">tls_endpoint</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">domain</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;app.example.com&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">listen</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token keyword" style="color:#00009f">await</span><span class="token operator" style="color:#393A34">?</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token macro property" style="color:#36acaa">println!</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;Listening on URL: {:?}&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> tun</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">url</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token class-name">Ok</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">tun</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Rust Crate Docs:</p> <ul> <li><a href="https://docs.rs/ngrok/latest/ngrok/config/struct.TlsTunnelBuilder.html#method.domain" target="_blank" rel="noopener noreferrer">https://docs.rs/ngrok/latest/ngrok/config/struct.TlsTunnelBuilder.html#method.domain</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>TLS endpoints are not supported by the ngrok Kubernetes Operator</p></div></div></div></div></div> <br> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="terminate-at-agent">Terminate at Agent<a href="#terminate-at-agent" class="hash-link" aria-label="Direct link to Terminate at Agent" title="Direct link to Terminate at Agent">​</a></h3> <p>See <a href="/docs/tls/tls-termination/#zero-knowledge-tls-at-the-agent">Zero-Knowledge TLS at the Agent</a> for additional details.</p> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">Agent CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Agent Config</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">SSH</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Javascript</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Rust</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Kubernetes Controller</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-bash codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-bash codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">ngrok tls </span><span class="token number" style="color:#36acaa">80</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> --terminate-at agent </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">--url</span><span class="token plain"> app.example.com </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">--crt</span><span class="token plain"> /path/to/app-example-com-crt.pem </span><span class="token punctuation" style="color:#393A34">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">--key</span><span class="token plain"> /path/to/app-example-com-key.pem</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">tunnels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">example</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">proto</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> tls</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">terminate_at</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> agent</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">domain</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> app.example.com</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">addr</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">80</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">crt</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /path/to/app</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">example</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">com</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">crt.pem</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /path/to/app</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">example</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">com</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">key.pem</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>SSH does not support termination at the agent</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>The Go SDK does not support TLS termination at the SDK</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>The Javascript SDK does not support TLS termination at the SDK.</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>The Python SDK does not support TLS termination at the SDK.</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>The Rust SDK does not support TLS termination at the SDK.</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>TLS endpoints are not supported by the ngrok Kubernetes Operator</p></div></div></div></div></div> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="re-encrypt-to-upstream">Re-encrypt to Upstream<a href="#re-encrypt-to-upstream" class="hash-link" aria-label="Direct link to Re-encrypt to Upstream" title="Direct link to Re-encrypt to Upstream">​</a></h3> <p>If you terminate at the ngrok edge or ngrok agent, you may want to re-encrypt the connection from the agent to your upstream service. The ngrok agent supports this behavior by using the non-standard <code>tls://</code> scheme syntax.</p> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">Agent CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Agent Config</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">SSH</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Javascript</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Rust</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Kubernetes Controller</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-bash codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-bash codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">ngrok tls tls://localhost:443 --terminate-at</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">edge</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">tunnels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">example</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">proto</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> tls</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">addr</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> tls</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//localhost</span><span class="token punctuation" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">443</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">terminate_at</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> edge</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>Re-encrypting the connection to your upstream service with TLS is not supported via SSH.</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>Re-encrypting the connection to your upstream service with TLS is not supported in the Go SDK.</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-jsx codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-jsx codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> ngrok </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">require</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;@ngrok/ngrok&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">(</span><span class="token keyword" style="color:#00009f">async</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">function</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:#00009f">await</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">addr</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;tls://localhost:443&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">authtoken_from_env</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">true</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">proto</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">crt</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">key</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token console class-name">console</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">log</span><span class="token punctuation" style="color:#393A34">(</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Ingress established at: </span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">listener</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation method function property-access" style="color:#d73a49">url</span><span class="token template-string interpolation punctuation" style="color:#393A34">(</span><span class="token template-string interpolation punctuation" style="color:#393A34">)</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>An empty certificate and key will default to the ngrok edge&#x27;s automatically provisioned keypair. The upstream certificate of <code>localhost:443</code> will be validated by a filepath specified in the <code>SSL_CERT_FILE</code> environment variable (e.g. <code>SSL_CERT_FILE=/path/to/ca.crt</code>), or falling back to the host OS installed trusted certificate authorities.</p> <p>Javascript SDK Docs:</p> <ul> <li><a href="https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html</a></li> <li><a href="https://ngrok.github.io/ngrok-javascript/classes/Session.html#tlsEndpoint" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/classes/Session.html#tlsEndpoint</a></li> <li><a href="https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#addr" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#addr</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-python codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-python codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> ngrok</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;tls://localhost:443&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> authtoken_from_env</span><span class="token operator" style="color:#393A34">=</span><span class="token boolean" style="color:#36acaa">True</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> proto</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> crt</span><span class="token operator" style="color:#393A34">=</span><span class="token builtin">bytearray</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> key</span><span class="token operator" style="color:#393A34">=</span><span class="token builtin">bytearray</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string-interpolation string" style="color:#e3116c">f&quot;Ingress established at: </span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">{</span><span class="token string-interpolation interpolation">listener</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">.</span><span class="token string-interpolation interpolation">url</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">(</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">)</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">}</span><span class="token string-interpolation string" style="color:#e3116c">&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>An empty certificate and key will default to the ngrok edge&#x27;s automatically provisioned keypair. The upstream certificate of <code>localhost:443</code> will be validated by a filepath specified in the <code>SSL_CERT_FILE</code> environment variable (e.g. <code>SSL_CERT_FILE=/path/to/ca.crt</code>), or falling back to the host OS installed trusted certificate authorities.</p> <p>Python SDK Docs:</p> <ul> <li><a href="https://ngrok.github.io/ngrok-python/module.html#ngrok.connect" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/module.html#ngrok.connect</a></li> <li><a href="https://ngrok.github.io/ngrok-python/index.html#full-configuration" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/index.html#full-configuration</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>Re-encrypting the connection to your upstream service with TLS is not yet supported in the Rust SDK.</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>TLS endpoints are not supported by the ngrok Kubernetes Operator</p></div></div></div></div></div> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="proxy-protocol">PROXY Protocol<a href="#proxy-protocol" class="hash-link" aria-label="Direct link to PROXY Protocol" title="Direct link to PROXY Protocol">​</a></h3> <p>Add a <a href="https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt" target="_blank" rel="noopener noreferrer">PROXY protocol</a> header on connection to your upstream service. This sends connection information like the original client IP address to your upstream service.</p> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">Agent CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Agent Config</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">SSH</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Javascript</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Rust</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">Kubernetes Controller</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-bash codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-bash codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">ngrok tls </span><span class="token number" style="color:#36acaa">443</span><span class="token plain"> --upstream-proxy-protocol</span><span class="token operator" style="color:#393A34">=</span><span class="token number" style="color:#36acaa">2</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">tunnels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">example</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">proto</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> tls</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">addr</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">443</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">proxy_protocol</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">2</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>PROXY proto is not support via SSH.</p></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-go codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-go codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;context&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;net&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;golang.ngrok.com/ngrok&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;golang.ngrok.com/ngrok/config&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">func</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">ngrokListener</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">ctx context</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">Context</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">net</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">Listener</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token builtin">error</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">return</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">Listen</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">ctx</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">TLSEndpoint</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> config</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithProxyProto</span><span class="token punctuation" style="color:#393A34">(</span><span class="token number" style="color:#36acaa">2</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">WithAuthtokenFromEnv</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Go Package Docs:</p> <ul> <li><a href="https://pkg.go.dev/golang.ngrok.com/ngrok/config#WithProxyProto" target="_blank" rel="noopener noreferrer">https://pkg.go.dev/golang.ngrok.com/ngrok/config#WithProxyProto</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-jsx codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-jsx codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> ngrok </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">require</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;@ngrok/ngrok&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">(</span><span class="token keyword" style="color:#00009f">async</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">function</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:#00009f">await</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">addr</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8080</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">authtoken_from_env</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">true</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">proto</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">proxy_proto</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&quot;2&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token console class-name">console</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">log</span><span class="token punctuation" style="color:#393A34">(</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Ingress established at: </span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">listener</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation method function property-access" style="color:#d73a49">url</span><span class="token template-string interpolation punctuation" style="color:#393A34">(</span><span class="token template-string interpolation punctuation" style="color:#393A34">)</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Javascript SDK Docs:</p> <ul> <li><a href="https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#proxy_proto" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#proxy_proto</a></li> <li><a href="https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#proxyProto" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#proxyProto</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-python codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-python codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> ngrok</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">listener </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> ngrok</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">forward</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;localhost:8080&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> authtoken_from_env</span><span class="token operator" style="color:#393A34">=</span><span class="token boolean" style="color:#36acaa">True</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> proto</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">&quot;tls&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> proxy_proto</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">&quot;2&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string-interpolation string" style="color:#e3116c">f&quot;Ingress established at: </span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">{</span><span class="token string-interpolation interpolation">listener</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">.</span><span class="token string-interpolation interpolation">url</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">(</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">)</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">}</span><span class="token string-interpolation string" style="color:#e3116c">&quot;</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Python SDK Docs:</p> <ul> <li><a href="https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.proxy_proto" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/tls_listener_builder.html#ngrok.TlsListenerBuilder.proxy_proto</a></li> <li><a href="https://ngrok.github.io/ngrok-python/index.html#full-configuration" target="_blank" rel="noopener noreferrer">https://ngrok.github.io/ngrok-python/index.html#full-configuration</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-rust codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-rust codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">use</span><span class="token plain"> </span><span class="token namespace" style="opacity:0.7">ngrok</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token namespace" style="opacity:0.7">prelude</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token operator" style="color:#393A34">*</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">async</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">fn</span><span class="token plain"> </span><span class="token function-definition function" style="color:#d73a49">listen_ngrok</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-&gt;</span><span class="token plain"> </span><span class="token namespace" style="opacity:0.7">anyhow</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token class-name">Result</span><span class="token operator" style="color:#393A34">&lt;</span><span class="token keyword" style="color:#00009f">impl</span><span class="token plain"> </span><span class="token class-name">Tunnel</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">let</span><span class="token plain"> sess </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token namespace" style="opacity:0.7">ngrok</span><span class="token namespace punctuation" style="opacity:0.7;color:#393A34">::</span><span class="token class-name">Session</span><span class="token punctuation" style="color:#393A34">::</span><span class="token function" style="color:#d73a49">builder</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">authtoken_from_env</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">connect</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token keyword" style="color:#00009f">await</span><span class="token operator" style="color:#393A34">?</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token keyword" style="color:#00009f">let</span><span class="token plain"> tun </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> sess</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">tls_endpoint</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">proxy_proto</span><span class="token punctuation" style="color:#393A34">(</span><span class="token class-name">ProxyProto</span><span class="token punctuation" style="color:#393A34">::</span><span class="token constant" style="color:#36acaa">V2</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">listen</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">.</span><span class="token keyword" style="color:#00009f">await</span><span class="token operator" style="color:#393A34">?</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token macro property" style="color:#36acaa">println!</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;Listening on URL: {:?}&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> tun</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">url</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token class-name">Ok</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">tun</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Rust Crate Docs:</p> <ul> <li><a href="https://docs.rs/ngrok/latest/ngrok/config/struct.TlsTunnelBuilder.html#method.proxy_proto" target="_blank" rel="noopener noreferrer">https://docs.rs/ngrok/latest/ngrok/config/struct.TlsTunnelBuilder.html#method.proxy_proto</a></li> </ul></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="theme-admonition theme-admonition-info admonition_lLl2 alert alert--info"><div class="admonitionHeading_W0l2"><span class="admonitionIcon_qwqe"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_WR9v"><p>TLS Endpoints are not supported via the ngrok Kubernetes Operator</p></div></div></div></div></div> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="behavior">Behavior<a href="#behavior" class="hash-link" aria-label="Direct link to Behavior" title="Direct link to Behavior">​</a></h2> <p>TLS endpoints allow you to deliver any application that uses TLS as its encryption transport. They provide you with complete flexibility to define where TLS termination occurs. You may ask ngrok to terminate TLS at the ngrok edge, the agent or at your upstream service. Consult the <a href="/docs/tls/tls-termination/">TLS Termination</a> module documentation for additional detail.</p> <p>It is very common to encounter certificate errors when working with TLS endpoints because the behavior changes depending on where you terminate TLS. The <a href="/docs/tls/tls-termination/#certificates">Certificates</a> documentation contains details about what certificates are used under which circumstances.</p> <p>TLS endpoints always use 443 as the port on their domain. TLS endpoints use the <a href="#compatible-clients">Server Name Information (SNI)</a> data on incoming TLS connections to route connections to the appropriate endpoint.</p> <p>Protocols that begin in plain text and upgrade to TLS via a mechanism like STARTTLS in SMTP, IMAP, etc are not supported.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="endpoints">Endpoints<a href="#endpoints" class="hash-link" aria-label="Direct link to Endpoints" title="Direct link to Endpoints">​</a></h3> <p>When your TLS endpoint is online, it will be available as an <a href="/docs/api/resources/endpoints/">Endpoint resource</a>. Endpoints have URLs, but there is no standard scheme for TLS URLs so ngrok renders them as <code>tls://</code>.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="compatible-clients">Compatible Clients<a href="#compatible-clients" class="hash-link" aria-label="Direct link to Compatible Clients" title="Direct link to Compatible Clients">​</a></h3> <p>All modern TLS clients populate the SNI extension. Some older clients do not. These clients will not work properly with ngrok&#x27;s TLS endpoints. The following list of clients do not support SNI and will not work with TLS endpoints:</p> <ul> <li>Microsoft Internet Explorer 6.0</li> <li>Microsoft Internet Explorer 7 &amp; 8 on Windows XP or earlier</li> <li>Native browser on Android 2.X</li> <li>Java &lt;=1.6</li> <li><a href="https://stackoverflow.com/questions/18578439/using-requests-with-tls-doesnt-give-sni-support/18579484#18579484" target="_blank" rel="noopener noreferrer">Python 2.X, 3.0, 3.1 if required modules are not installed</a></li> </ul> <p>A more complete list can be found on <a href="https://en.wikipedia.org/wiki/Server_Name_Indication#No_support" target="_blank" rel="noopener noreferrer">the Server Name Indication page on Wikipedia</a></p> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="reference">Reference<a href="#reference" class="hash-link" aria-label="Direct link to Reference" title="Direct link to Reference">​</a></h2> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="edges">Edges<a href="#edges" class="hash-link" aria-label="Direct link to Edges" title="Direct link to Edges">​</a></h3> <p><a href="/docs/network-edge/edges/">Edges</a> enable you to centrally manage your endpoints&#x27; Module configurations in the ngrok dashboard or API instead of defining them via an Agent or Agent SDK.</p> <ul> <li>A TLS Edge is attached to one or more Domains. For each Domain, it creates a TLS Endpoint that it listens for traffic on.</li> <li>When a Domain is associated with a TLS Edge, agents may no longer start endpoints on that Domain. You can always detach a Domain from your Edge if you want to create Endpoints on it from an Agent or Agent SDK.</li> <li>Modules on a TLS Edge are attached directly to the edge itself. There are no Routes.</li> <li>When you create a TLS Edge via the dashboard, it will automatically create a new Domain with a random name and assign it to your Edge.</li> <li>When you create an TLS Edge via the dashboard, it will automatically create a <a href="/docs/network-edge/edges/#tunnel-group">Tunnel Group Backend</a> with a unique label.</li> </ul> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="modules">Modules<a href="#modules" class="hash-link" aria-label="Direct link to Modules" title="Direct link to Modules">​</a></h3> <p>Use modules to modify the behavior of traffic flowing through your endpoints.</p> <table><thead><tr><th>Module</th><th>Description</th></tr></thead><tbody><tr><td><a href="/docs/tls/mutual-tls/">Mutual TLS</a></td><td>Perform mutual TLS authentication when terminating TLS connections with a configured set of certificate authorities.</td></tr><tr><td><a href="/docs/tls/tls-termination/">TLS</a></td><td>Configure whether ngrok terminates TLS traffic at its edge or forwards the TLS traffic through unterminated.</td></tr><tr><td><a href="/docs/tls/ip-restrictions/">IP Restrictions</a></td><td>Allow or deny traffic based on the source IP of connections</td></tr></tbody></table> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="observability">Observability<a href="#observability" class="hash-link" aria-label="Direct link to Observability" title="Direct link to Observability">​</a></h3> <p>Use <a href="/docs/obs/">ngrok&#x27;s events system</a> to capture logs of TLS connections to your endpoints.</p> <p>When TLS connections to your endpoints are closed, <a href="/docs/obs/reference/#tcp-connection-closed">tcp_connection_closed.v0</a> events are published.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="errors">Errors<a href="#errors" class="hash-link" aria-label="Direct link to Errors" title="Direct link to Errors">​</a></h3> <p>If the TLS handshake fails, a TLS abort code will be sent to the client.</p> <p>In all other cases, if an error is encountered while handling TLS connections to your endpoints (e.g. no available backends or internal server error), the connection will simply be closed. The TLS protocol and its implementations are not sufficiently flexible enough to deliver additional rich error information when failures are encountered.</p> <p>You can use the <a href="#observability">observability</a> primitives to understand the error handling behavior of a connection.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="pricing">Pricing<a href="#pricing" class="hash-link" aria-label="Direct link to Pricing" title="Direct link to Pricing">​</a></h3> <p><a href="https://ngrok.com/pricing" target="_blank" rel="noopener noreferrer">Current plans and price points can be found on our website</a>.</p> <p>TLS endpoints are available on the Pay-as-you-go, Pro, and Enterprise plans.</p> <p>Zero-knowledge TLS is available on the Enterprise plan.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/ngrok/ngrok-docs/edit/main/docs/tls/index.mdx" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_pNyv" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_wOM1"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2024-11-26T19:41:31.000Z" itemprop="dateModified">Nov 26, 2024</time></b> by <b>samcrichard</b></span></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/http/websocket-tcp-converter/"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Websocket TCP Converter</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/tls/ip-restrictions/"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">IP Restrictions</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_iEsB thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#overview" class="table-of-contents__link toc-highlight">Overview</a></li><li><a href="#example-usage" class="table-of-contents__link toc-highlight">Example Usage</a><ul><li><a href="#terminate-at-edge" class="table-of-contents__link toc-highlight">Terminate at Edge</a></li><li><a href="#terminate-at-upstream" class="table-of-contents__link toc-highlight">Terminate at Upstream</a></li><li><a href="#terminate-at-agent" class="table-of-contents__link toc-highlight">Terminate at Agent</a></li><li><a href="#re-encrypt-to-upstream" class="table-of-contents__link toc-highlight">Re-encrypt to Upstream</a></li><li><a href="#proxy-protocol" class="table-of-contents__link toc-highlight">PROXY Protocol</a></li></ul></li><li><a href="#behavior" class="table-of-contents__link toc-highlight">Behavior</a><ul><li><a href="#endpoints" class="table-of-contents__link toc-highlight">Endpoints</a></li><li><a href="#compatible-clients" class="table-of-contents__link toc-highlight">Compatible Clients</a></li></ul></li><li><a href="#reference" class="table-of-contents__link toc-highlight">Reference</a><ul><li><a href="#edges" class="table-of-contents__link toc-highlight">Edges</a></li><li><a href="#modules" class="table-of-contents__link toc-highlight">Modules</a></li><li><a href="#observability" class="table-of-contents__link toc-highlight">Observability</a></li><li><a href="#errors" class="table-of-contents__link toc-highlight">Errors</a></li><li><a href="#pricing" class="table-of-contents__link toc-highlight">Pricing</a></li></ul></li></ul></div></div></div></div></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">ngrok Service</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started/">Get Started</a></li><li class="footer__item"><a href="https://dashboard.ngrok.com/signup" target="_blank" rel="noopener noreferrer" class="footer__link-item">Sign up</a></li><li class="footer__item"><a href="https://dashboard.ngrok.com/login" target="_blank" rel="noopener noreferrer" class="footer__link-item">Log in</a></li><li class="footer__item"><a href="https://download.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Download</a></li><li class="footer__item"><a href="https://ngrok.com/docs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Docs</a></li><li class="footer__item"><a href="https://status.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Status</a></li></ul></div><div class="col footer__col"><div class="footer__title">ngrok.com</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://ngrok.com/product" target="_blank" rel="noopener noreferrer" class="footer__link-item">Product</a></li><li class="footer__item"><a href="https://ngrok.com/pricing" target="_blank" rel="noopener noreferrer" class="footer__link-item">Pricing</a></li><li class="footer__item"><a href="https://ngrok.com/customers" target="_blank" rel="noopener noreferrer" class="footer__link-item">Customers</a></li><li class="footer__item"><a href="https://ngrok.com/solutions" target="_blank" rel="noopener noreferrer" class="footer__link-item">Solutions</a></li><li class="footer__item"><a href="https://ngrok.com/partners" target="_blank" rel="noopener noreferrer" class="footer__link-item">Partners</a></li><li class="footer__item"><a href="https://trust.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Trust Portal</a></li></ul></div><div class="col footer__col"><div class="footer__title">Legal</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://ngrok.com/abuse" target="_blank" rel="noopener noreferrer" class="footer__link-item">Abuse</a></li><li class="footer__item"><a href="https://ngrok.com/dpa" target="_blank" rel="noopener noreferrer" class="footer__link-item">DPA</a></li><li class="footer__item"><a href="https://ngrok.com/privacy" target="_blank" rel="noopener noreferrer" class="footer__link-item">Privacy</a></li><li class="footer__item"><a href="https://ngrok.com/security" target="_blank" rel="noopener noreferrer" class="footer__link-item">Security</a></li><li class="footer__item"><a href="https://ngrok.com/tos" target="_blank" rel="noopener noreferrer" class="footer__link-item">Terms of service</a></li><li class="footer__item"><a href="https://ngrok.com/privacy-preferences" target="_blank" rel="noopener noreferrer" class="footer__link-item">Privacy Preferences</a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://ngrok.com/careers" target="_blank" rel="noopener noreferrer" class="footer__link-item">Careers</a></li><li class="footer__item"><a href="https://blog.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Blog</a></li><li class="footer__item"><a href="https://ngrok.com/slack" target="_blank" rel="noopener noreferrer" class="footer__link-item">Community</a></li><li class="footer__item"><a href="https://twitter.com/ngrokHQ" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://www.linkedin.com/company/ngrok" target="_blank" rel="noopener noreferrer" class="footer__link-item">LinkedIn</a></li><li class="footer__item"><a href="https://github.com/ngrok" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">© ngrok 2024</div></div></div></footer></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10