Sauce Connect Proxy Setup with Additional Proxies
The Sauce Connect Proxy 4.x.x version of this article is here.
This guide is intended for users who need to set up additional proxies to route traffic originated from their Sauce Connect Proxy client. Additional proxies may be configured for various purposes such as improved network security, corporate internet usage policy, traffic monitoring, or caching. Sauce Connect Proxy network traffic includes:
- Traffic between Sauce Labs and a Sauce Connect Proxy client.
- Connections are initiated by a Sauce Connect Proxy client.
- Requests between a Sauce Connect Proxy client and the Sauce Labs REST API service, such as start and stop requests and status updates.
- Sauce Connect Proxy long-lived HTTP/2 tunnel connection.
- Traffic between Sauce Connect Proxy and the internet or internal servers serving data that your tests running on Sauce Labs infrastructure use.
- This traffic originates from Sauce Labs-hosted browsers and mobile devices that are running your tests.
Setting Up Sauce Connect With Your Proxy Server
Two types of network traffic that are relevant to using proxy servers with Sauce Connect Proxy:
- Test Traffic: The Sauce Connect Proxy communicates with the Site Under Test (SUT) running in your network or public internet.
- Sauce Labs traffic
- REST API Traffic: The Sauce Connect Proxy client running on your network communicates to our REST API service some basic information about the Sauce Connect Proxy's status (for example, starting up, ready, stopping).
- Tunnel Traffic: The Sauce Connect Proxy client establishes a secure long-lived connection to the Sauce Connect Proxy server in the Sauce Labs cloud to multiplex the SUT-bound traffic.
To configure Sauce Connect Proxy to use your proxy or proxies, you will need to include one or more Sauce Connect command-line options (see the Sauce Connect Proxy Command-Line Quick Reference Guide).
-x
/--proxy
allows configuring proxy for SUT (test) traffic.--pac
allows configuring proxy for SUT (test) traffic via Proxy Auto-Configuration (PAC).--proxy-sauce
allows configuring proxy for Sauce Labs REST API traffic and the tunnel traffic.--auth
allows configuring proxy authentication separately.
Proxied Site Under Test (SUT)
In this configuration, the Site Under Test (SUT) is behind a proxy (sometimes also called an upstream proxy), see the diagram below. This setup controls access to the SUT by IP allow-listing or by restricting proxy access to users with valid username/password credentials. Depending on your setup, this proxy may or may not be able to access the public internet.
