Using Sauce Connect Proxy Tunnels
What You'll Need
- If you haven't already, make sure you can access the website or mobile app that you'll be testing from the Sauce Connect Proxy host.
- We recommend using cURL or an equivalent tool.
- Check to see if you have any proxies that are required to access the public Internet.
- Review the Basic Sauce Connect Proxy Setup for instructions on how to set your Sauce Labs username and access key and launch a tunnel.
- If you're using Jenkins, or GitHub Actions, be sure to review Sauce Connect Proxy CI/CD Integration.
Best Practice for Using Tunnels
We recommend using a single Sauce Connect Proxy tunnel or tunnel pool for each test suite or build, and tearing it down at the end of your test. Your test automation framework should launch Sauce Connect Proxy before the test suite is triggered and shut it down when the suite finishes.
If you're using a continuous integration platform like Jenkins, you can use the Sauce OnDemand plugin to launch and tear down your Sauce Connect Proxy instance. For more information, see Setting Up CI Platform Integrations with Sauce Plugins.
Security Considerations
If your Sauce Connect client is running on a multi-user system, we recommend using a YAML config file or setting environment variables to hide sensitive information like your password (--api-key
) and proxy credentials. This way, they won't be visible in the list of running processes.
Starting Tunnels
Every Sauce Connect Proxy tunnel spins up a fresh virtual machine (VM) that is used only for your tests. Once the tunnel is closed, VMs are destroyed. For information about user roles and permissions, see User Roles.
Tunnels must be started from the command line of the machine where the Sauce Connect Proxy client is installed. As a shortcut, you can copy the run command (see Tunnels page > Step 3) and paste it into your CLI. Optionally, you can add tunnel configuration parameters. See Quickstart and Sauce Connect Proxy Basic Setup for instructions.
Monitoring Tunnels
You can manage and monitor all Sauce Connect Proxy tunnel activity from the Sauce Labs Tunnels page, which displays useful information, such as the number of active tunnels, tunnel status, and specific attributes for each tunnel. You can also check the health of an individual tunnel by running a test on it.
Column | Description |
---|---|
Type | The icon shows whether the tunnel is a Sauce Connect Proxy, or an Sauce IPSec Proxy. |
State | The icon shows whether the tunnel is running or stopped. |
Tunnel Name | The name of the tunnel. This is the --tunnel-name used when starting the Sauce Connect tunnel. |
Client Hostname | The name of the machine where the Sauce Connect Proxy client is running. |
Owner | The name of the account that is running the tunnel. |
Sharing | Indicates whether or not the tunnel is shared. |
Duration | The amount of time the tunnel has been running. |
Verifying Tunnel Success
To verify that your tunnel is up and running, you can check the following: