Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/uploads/bypassproxydomain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions docs/bypass-proxy-domains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
id: bypass-proxy-domains
title: How to Bypass Proxy Domains
hide_title: false
sidebar_label: Bypass Proxy Domains
description: Learn how to use LambdaTest bypassProxyDomains capability to specify domains that should bypass the dedicated proxy.
keywords:
- custom headers lambdatest
- bypass firewalls restrictions
- custom headers bypass firewalls
url: https://www.lambdatest.com/support/docs/bypass-proxy-domains/
site_name: LambdaTest
slug: bypass-proxy-domains/
---

<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.lambdatest.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Support",
"item": "https://www.lambdatest.com/support/docs/"
},
{
"@type": "ListItem",
"position": 3,
"name": "Bypass Proxy Domains",
"item": "https://www.lambdatest.com/support/docs/bypass-proxy-domains/"
}
]})
}}>
</script>

When running tests with Dedicated Proxy (DP) enabled, all outgoing requests are routed through the proxy. While this provides secure and controlled network access, it can sometimes cause issues when your tests need to access services running locally, such as localhost endpoints or specific internal domains.

To solve this, you can use the `bypassProxyDomains` capability. This capability lets you define a list of domains that should bypass the dedicated proxy and instead be resolved directly from the test environment.

With `bypassProxyDomains`, you can configure specific domains (like localhost) to skip the proxy hop and resolve locally. This ensures that local APIs, servers, or background services started during tests remain accessible.

## Capability Reference

| Capability | Type | Required | Description |
| -------------------- | --------- | -------- | ------------------------------------------------------------------------------ |
| `dedicatedProxy` | `boolean` | Yes | Must be set to `true` for `bypassProxyDomains` to take effect. |
| `bypassProxyDomains` | `array` | Optional | List of domains (hostnames) to bypass the dedicated proxy and resolve locally. |

> `dedicatedProxy: true` is mandatory for bypassProxyDomains to take effect.

## Example Usage

```java title="test1.java"
DesiredCapabilities capabilities = new DesiredCapabilities();
String bypassProxyDomains[] = { "127.0.0.1", "localhost", "todomvc" };

capabilities.setCapability("dedicatedProxy", true);
capabilities.setCapability("bypassProxyDomains", bypassProxyDomains);
```

<img loading="lazy" src={require('../assets/images/uploads/bypassproxydomain.png').default} alt="cmd" width="768" height="373" className="doc_img"/>
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -3761,6 +3761,7 @@ module.exports = {
"load-balancing-in-lambda-tunnel",
"charles-proxy",
"dedicated-proxy",
"bypass-proxy-domains",
"socks5-proxy-support",
"http2-support", // Added HTTP/2 support doc
],
Expand Down
Loading