Sauce Connect Proxy™ is a built-in HTTP proxy server that opens a secure "tunnel"
connection for testing between a Sauce Labs virtual
machine or real device and a website or mobile app hosted on your local computer ("
localhost") or behind a corporate firewall. It provides a means for Sauce Labs to access your application or website.
See the following sections for more information:
|Table of Contents|
When is Sauce Connect Proxy Necessary?
It is required only in situations where your website or app being tested in Sauce Labs is on a private network and not publicly accessible.
Sauce Connect Proxy Benefits
Sauce Connect Proxy has some other uses in your testing network architecture:
- Provides ability to monitor upstream traffic through a proxy like BrowserMob
- Stabilizes network connections (e.g., detecting and re-sending dropped packets)
- You can use WonderProxy to change the Geolocation of your test traffic
How Sauce Connect Proxy Works
Sauce Connect Proxy is based on a proprietary protocol that runs over TLS and is available for use by any Sauce Labs account. For information on downloading, setting up, and configuring Sauce Connect Proxy in your network architecture, please see the topics under Getting Started with Sauce Connect Proxy and Sauce Connect Proxy Setup and Configuration.
All requests and responses between the browsers running the Selenium test and the web servers pass through it. Since Sauce Connect Proxy is just being used internally in your Sauce Labs testing, it doesn't matter which port it uses. A free port is allocated dynamically when Sauce Connect Proxy is started.
Choosing the Right Direction for You or Your Team
Below are our recommendations for getting started with your Sauce Labs automated testing, using Sauce Connect Proxy. Our setup types vary, based on your subscription plan, team size, and number of tests.
Getting Started with Sauce Connect Proxy: Our Basic Setup
First time using Sauce Labs? Get up and running fast with our Basic Sauce Connect Proxy Setup. This will guide you through starting a simple test tunnel to confirm your Sauce Connect Proxy setup is running smoothly.
We highly recommend doing so before moving onto more complex setups below.
Ephemeral, Short-Lived Tunnels
Sauce Connect Ephemeral tunnels – short-lived tunnels – are ideal for the following test situations:
You are the sole user of Sauce Connect Proxy in your team/organization
Your plan to run Sauce Labs tests frequently (i.e., hourly or daily)
You do not test frequently on Sauce Labs, but you do rely on your Continuous Integration/Continuous Deployment (CI/CD) pipeline
You have multiple, automated agents/workers running Sauce Labs tests that are dispatched from their CI/CD system
You use live tests with Real Devices or Emulators/Simulators daily
You run tests on Sauce Labs from your local machine before you commit or merge your code
For more information, see Sauce Connect Proxy Tunnel Types: Ephemeral, Long-Running, Combination.
Long-Running are best suited for the High Availability Sauce Connect Proxy Setup, which allows you to launch a high volume of tunnels and/or durations. This is ideal – but not required – for enterprise-level users (i.e., high volume of tests and/or internal users).
Your security/network team requires traffic inspection
- You are running a very high number of parallel tests (i.e., 200 or more)
You are a part of a regulated entity
You have multiple team members running live or automated tests on Sauce Labs
You need a proxy to access the internet (i.e., the internet is not accessible unless you go through a secured proxy that reads all your traffic)
If your proxy has a username:password, you may have to run a cURL script (e.g., $ curl --proxy username:corporate_password:my.company-proxy.com:80), then secure help from your network/IT team to establish a tunnel or tunnels
Tunnels with Additional Proxies
If you have an existing internal network proxy, through which outbound communication is routed from their network to the public interne, the additional proxy configuration of the Sauce Connect tunnel is required. For more information, see Sauce Connect Proxy Setup with Additional Proxies.
If you use one of the following options in Sauce Labs, you'll need to create Sauce Connect Proxy tunnels specifically for those features: