Skip to content

Commit

Permalink
Merge 535edbe into 5afccf4
Browse files Browse the repository at this point in the history
  • Loading branch information
sebv authored Sep 15, 2023
2 parents 5afccf4 + 535edbe commit 5972eef
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion docs/orchestrate/sauce-connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,62 @@ tunnel-domains: [ ]
1. Add the [`tunnel`](/orchestrate/saucectl-configuration/#tunnel) key to the runner configuration.

## Container Configuration

When a Sauce Orchestrate container starts with Sauce Connect enabled, the following
environment variables are set:

```bash
# Reference (for manual configuration)
no_proxy=host.sauceconnect.internal,saucelabs.com,*.saucelabs.com
proxy_port=1080
# Java Opts (for manual configuration)
SAUCE_JAVA_OPTS=-Dhttp.proxyHost=host.sauceconnect.internal -Dhttp.proxyPort=1080 -Dhttps.proxyHost=host.sauceconnect.internal -Dhttps.proxyPort=1080 -Dhttp.nonProxyHosts=host.sauceconnect.internal|saucelabs.com|*.saucelabs.com
# Standard Proxy
https_proxy=http://host.sauceconnect.internal:1080
proxy_host=host.sauceconnect.internal
NO_PROXY=host.sauceconnect.internal,saucelabs.com,*.saucelabs.com
HTTPS_PROXY=http://host.sauceconnect.internal:1080
HTTP_PROXY=http://host.sauceconnect.internal:1080
http_proxy=http://host.sauceconnect.internal:1080
```

### Standard Proxy Configuration

In most programing language (Go, Python, Node.js...) the standard proxy environment
variables are supported, and there is no extra step to configure the
Sauce Connect.

### Java

Java is a notable exception. The standard proxy environment variable are not
supported, and system properties must be used instead. One way to configure
the system properties is to pass the `SAUCE_JAVA_OPTS` options when starting
a Java VM.

In Maven this may be done in several place
- For the main maven process setting `MAVEN_OPTS=$SAUCE_JAVA_OPTS`, or alternatively
in `settings.xml`
- For the Surefire processes in pom.xml as below:
```
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
...
<properties>
...
<argLine>${env.SAUCE_JAVA_OPTS}</argLine>
</properties>
```

This should me enough for libraries using the standard Java HTTP client. Some libraries
however differ from the standard and require the proxy configuration to be implemented
within code.

## More Information

- [Using Sauce Connect Proxy](/secure-connections/sauce-connect)
- [Using Additional Proxies with Sauce Connect Setups](/secure-connections/sauce-connect/setup-configuration/additional-proxies)
- [Using Additional Proxies with Sauce Connect Setups](/secure-connections/sauce-connect/setup-configuration/additional-proxies)

0 comments on commit 5972eef

Please sign in to comment.