|
| 1 | +--- |
| 2 | +id: tunnel-allowHost-wildcard-support |
| 3 | +title: Support for Wildcard in --allowHosts Flag |
| 4 | +hide_title: false |
| 5 | +sidebar_label: Wildcard Support |
| 6 | +description: Now you can use wildcard values for the -allow-Host flag for setting up the tunnel at lambdatest. |
| 7 | +keywords: |
| 8 | + - local app testing |
| 9 | + - lambdatest local testing |
| 10 | + - lambdatest local tunnel |
| 11 | + - LambdaTest tunnel |
| 12 | + - local app testing for linux |
| 13 | + - ssh connection |
| 14 | + - shared ssh |
| 15 | + - secure-shell-tunnel |
| 16 | + - docker compose ssh tunnel |
| 17 | + - docker vpn tunnel |
| 18 | +image: /assets/images/og-images/docker-tunnel.png |
| 19 | +url: https://www.lambdatest.com/support/docs/tunnel-allowHost-wildcard-support/ |
| 20 | +site_name: LambdaTest |
| 21 | +slug: tunnel-allowHost-wildcard-support/ |
| 22 | +--- |
| 23 | + |
| 24 | +<script type="application/ld+json" |
| 25 | + dangerouslySetInnerHTML={{ __html: JSON.stringify({ |
| 26 | + "@context": "https://schema.org", |
| 27 | + "@type": "BreadcrumbList", |
| 28 | + "itemListElement": [{ |
| 29 | + "@type": "ListItem", |
| 30 | + "position": 1, |
| 31 | + "name": "LambdaTest", |
| 32 | + "item": "https://www.lambdatest.com" |
| 33 | + },{ |
| 34 | + "@type": "ListItem", |
| 35 | + "position": 2, |
| 36 | + "name": "Support", |
| 37 | + "item": "https://www.lambdatest.com/support/docs/" |
| 38 | + },{ |
| 39 | + "@type": "ListItem", |
| 40 | + "position": 3, |
| 41 | + "name": "Docker Tunnel", |
| 42 | + "item": "https://www.lambdatest.com/support/docs/tunnel-allowHost-wildcard-support/" |
| 43 | + }] |
| 44 | + }) |
| 45 | + }} |
| 46 | +></script> |
| 47 | +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. |
| 48 | + |
| 49 | +## Usage of `--allowHosts` with Wildcards |
| 50 | +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. |
| 51 | + |
| 52 | +### Formatting Domains with Wildcards |
| 53 | +Follow these guidelines when using wildcards in domain names: |
| 54 | + |
| 55 | +#### Use only the domain name |
| 56 | +- Do not include `http://` or `https://`. |
| 57 | +- ✅ Example: `example.com`. |
| 58 | + |
| 59 | +#### Comma-separated list without spaces |
| 60 | +- Ensure that the list of domains is comma-separated with no spaces. |
| 61 | +- ✅ Example: `example.com`, `testsite.com`, `anotherdomain.com` |
| 62 | + |
| 63 | +#### Using Wildcards to Match Subdomains |
| 64 | +- Prefix the domain with a dot `(.)` to match all its subdomains. |
| 65 | +- Alternatively, you can use an asterisk `(*)` for the same effect. |
| 66 | +- ✅ Example: |
| 67 | + - `".example.com"` or `"*.example.com"` will match `sub.example.com`, `api.example.com`, `blog.example.com`, etc. |
| 68 | + |
| 69 | +:::tip Note |
| 70 | +Enclose the argument in **quotes** to prevent shell expansion of the **asterisk (*)**. |
| 71 | +::: |
| 72 | + |
| 73 | +## Benefits of Wildcard Support in `--allowHosts` |
| 74 | +- **Simplifies Configuration :** No need to manually list each subdomain. |
| 75 | +- **Increased Flexibility :** Easily manage multiple subdomains with a single entry. |
| 76 | +- **Better Performance :** Reduces manual domain management, improving efficiency. |
0 commit comments