From 9a9eabb1968f818f3a14c181579640ce2efe1256 Mon Sep 17 00:00:00 2001 From: ShubhamSuri <70204532+surishubham@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:46:29 +0530 Subject: [PATCH] Merge pull request #1328 from amanchopra1905/stage tunnel modifier - allowHost flag --- docs/lambda-tunnel-modifiers.md | 2 +- docs/tunnel-allowHost-wildcard-support.md | 76 +++++++++++++++++++++++ sidebars.js | 1 + 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 docs/tunnel-allowHost-wildcard-support.md diff --git a/docs/lambda-tunnel-modifiers.md b/docs/lambda-tunnel-modifiers.md index 52fb77e80..36bfaa047 100644 --- a/docs/lambda-tunnel-modifiers.md +++ b/docs/lambda-tunnel-modifiers.md @@ -50,7 +50,7 @@ This document will help you understand all the modifiers/arguments used with Lam | FLAG (SHORT) | FLAG (LONG) | DESCRIPTION | TYPE | | :----------- | :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | :------ | -| | --allowHosts | Comma separated list of hosts to route via tunnel. Everything else will be routed via Internet. | String | +| | --allowHosts | Comma separated list of hosts to route via tunnel. Everything else will be routed via Internet.
Learn how to use the [wildcard expressions](https://www.lambdatest.com/support/docs/tunnel-allowHost-wildcard-support/) in the `--allowHosts` flag | String | | | --bypassHosts | Comma separated list of hosts to bypass from tunnel. These will be routed via internet. | String | | | --callbackURL | Callback URL for tunnel status. | String | | -c | --config | Path of the config file to use | String | diff --git a/docs/tunnel-allowHost-wildcard-support.md b/docs/tunnel-allowHost-wildcard-support.md new file mode 100644 index 000000000..514caab4b --- /dev/null +++ b/docs/tunnel-allowHost-wildcard-support.md @@ -0,0 +1,76 @@ +--- +id: tunnel-allowHost-wildcard-support +title: Support for Wildcard in --allowHosts Flag +hide_title: false +sidebar_label: Wildcard Support +description: Now you can use wildcard values for the -allow-Host flag for setting up the tunnel at lambdatest. +keywords: + - local app testing + - lambdatest local testing + - lambdatest local tunnel + - LambdaTest tunnel + - local app testing for linux + - ssh connection + - shared ssh + - secure-shell-tunnel + - docker compose ssh tunnel + - docker vpn tunnel +image: /assets/images/og-images/docker-tunnel.png +url: https://www.lambdatest.com/support/docs/tunnel-allowHost-wildcard-support/ +site_name: LambdaTest +slug: tunnel-allowHost-wildcard-support/ +--- + + +LambdaTest Tunnel now supports wildcard entries in the [`--allowHosts`](https://lambdatest.com/support/docs/lambda-tunnel-modifiers/#:~:text=TYPE-,%2D%2DallowHosts,-Comma%20separated%20list) flag. This enhancement allows users to specify patterns for hostnames instead of listing each subdomain separately, making it more flexible and efficient. + +## Usage of `--allowHosts` with Wildcards +The `--allowHosts` flag enables users to define which domains should be routed through the LambdaTest Tunnel while allowing other traffic to bypass it. With the new wildcard support, you can match multiple subdomains easily. + +### Formatting Domains with Wildcards +Follow these guidelines when using wildcards in domain names: + +#### Use only the domain name +- Do not include `http://` or `https://`. +- ✅ Example: `example.com`.        + +#### Comma-separated list without spaces +- Ensure that the list of domains is comma-separated with no spaces. +- ✅ Example: `example.com`, `testsite.com`, `anotherdomain.com` + +#### Using Wildcards to Match Subdomains +- Prefix the domain with a dot `(.)` to match all its subdomains. +- Alternatively, you can use an asterisk `(*)` for the same effect. +- ✅ Example: + - `".example.com"` or `"*.example.com"` will match `sub.example.com`, `api.example.com`, `blog.example.com`, etc. + +:::tip Note +Enclose the argument in **quotes** to prevent shell expansion of the **asterisk (*)**. +::: + +## Benefits of Wildcard Support in `--allowHosts` +- **Simplifies Configuration :** No need to manually list each subdomain. +- **Increased Flexibility :** Easily manage multiple subdomains with a single entry. +- **Better Performance :** Reduces manual domain management, improving efficiency. \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index afde8fbdf..eff4a9b3b 100644 --- a/sidebars.js +++ b/sidebars.js @@ -3224,6 +3224,7 @@ module.exports = { "load-balancing-in-lambda-tunnel", "dedicated-proxy", "charles-proxy", + "tunnel-allowHost-wildcard-support" ], ],