Skip to content

Commit 5f4653f

Browse files
authored
Merge branch 'main' into mb/SC-5308/upstream-auth
2 parents 53bbccb + 8cf844c commit 5f4653f

File tree

3 files changed

+186
-79
lines changed

3 files changed

+186
-79
lines changed

docs/secure-connections/sauce-connect-5/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Entering this code -- `(www.)?google-analytics.com,(www.)?googletagmanager.com,(
5353

5454
You can access `localhost` through Sauce Connect on Virtual Desktop Browser tests. However, you cannot proxy `localhost` or 127.0.0.1 connections on any Mobile tests, whether they are Emulators, Simulators, or Real Devices.
5555

56-
When using Sauce Connect Proxy, local websites running on commonly used ports are available to test at `localhost` or 127.0.0.1 URLs. The exception is when testing on Real or Virtual Mobile Devices. Real and Virtual Mobile tests require changes to the `/etc/hosts` file where Sauce Connect Proxy is hosted. For more information, see [Testing Mobile Devices Against localhost](/secure-connections/sauce-connect-5/guides/configuration/#sc5localhost).
56+
When using Sauce Connect Proxy, local websites running on commonly used ports are available to test at `localhost` or 127.0.0.1 URLs. The exception is when testing on Real or Virtual Mobile Devices. Real and Virtual Mobile tests require changes to the `/etc/hosts` file where Sauce Connect Proxy is hosted. For more information, see [Testing Mobile Devices Against localhost](/secure-connections/sauce-connect-5/specifications/localhost-ports/#configuring-mobile-devices-for-testing-localhost).
5757

5858
For all platforms, tests may perform better when using a locally defined domain name (which can be set in your [`hosts` file](http://en.wikipedia.org/wiki/Hosts_file)) rather than `localhost`. Using a locally defined domain name also allows access to apps on any port. If you are using a parent proxy with Sauce Connect, you may need the [`--proxy-localhost` flag](/dev/cli/sauce-connect-5/run/#proxy-localhost).
5959

docs/secure-connections/sauce-connect-5/guides/configuration.md

Lines changed: 173 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -48,72 +48,107 @@ and their usage.
4848
4949
# access-key <UUID>
5050
#
51-
# Sauce Labs Access Key, you can get it from the User Settings page. For
52-
# additional security, we recommend setting this as an environment variable.
53-
#access-key:
51+
# Sauce Labs Access Key, you can get it from the User Settings page:
52+
# https://app.saucelabs.com/user-settings. For additional security, we recommend
53+
# setting this as an environment variable.
54+
#access-key:
5455
5556
# region <data center>
5657
#
57-
# Sauce Labs region name, ex. us-west or eu-central.
58-
#region:
58+
# Sauce Labs region name, ex. us-west, us-east, or eu-central. More details
59+
# here: https://docs.saucelabs.com/basics/data-center-endpoints.
60+
#region:
5961
6062
# tunnel-name <name>
6163
#
6264
# Name of the tunnel or tunnel pool. You can run tests using this tunnel by
63-
# specifying the tunnelName value in your test capabilities.
64-
#tunnel-name:
65+
# specifying the tunnelName value in your test capabilities, see here:
66+
# https://docs.saucelabs.com/dev/test-configuration-options/. It can also assign
67+
# a name to a group of tunnels in the same high availability pool, see here:
68+
# https://docs.saucelabs.com/secure-connections/sauce-connect/setup-configuration/high-availability/.
69+
#tunnel-name:
6570
6671
# username <username>
6772
#
6873
# Sauce Labs username. For additional security, we recommend setting this as an
6974
# environment variable.
70-
#username:
75+
#username:
7176
7277
# --- Options ---
7378
7479
# metadata <key=value>,...
7580
#
76-
# Custom metadata key-value pairs.
77-
#metadata:
81+
# Custom metadata key-value pairs. This flag is, primarily, used by Sauce Labs
82+
# to assign custom properties to the tunnel for reporting purposes.
83+
#metadata:
7884
7985
# shared <all>
8086
#
8187
# Share the tunnel within the same org unit. Only the 'all' option is currently
82-
# supported.
83-
#shared:
88+
# supported. See here:
89+
# https://docs.saucelabs.com/basics/acct-team-mgmt/sauce-connect-proxy-tunnels/.
90+
#shared:
8491
8592
# tunnel-pool <value>
8693
#
87-
# Denotes a tunnel as part of a high availability tunnel pool.
94+
# Denotes a tunnel as part of a high availability tunnel pool. See here:
95+
# https://docs.saucelabs.com/secure-connections/sauce-connect/setup-configuration/high-availability/.
8896
#tunnel-pool: false
8997
9098
# --- Tunnel traffic ---
9199
92100
# deny-domains [-]<regexp>,...
93101
#
94-
# Deny requests to the matching domains.
95-
#deny-domains:
102+
# Deny requests to the matching domains. Prefix domains with '-' to exclude
103+
# requests from being denied. Special keyword 'all' matches all domains.
104+
#
105+
# The following example denies requests to *.example.com and *.google.com.
106+
#
107+
# --deny-domains .*\.example\.com,.*\.google\.com
108+
#deny-domains:
96109
97110
# direct-domains [-]<regexp>,...
98111
#
99112
# Forward matching requests to their origin server over the public internet.
100113
# Requests that don't match "direct domains" will be forwarded to customer-side
101114
# over the Sauce Connect Proxy connection. You can specify --direct-domains or
102-
# --tunnel-domains, but not both.
103-
#direct-domains:
115+
# --tunnel-domains, but not both. Prefix domains with '-' to exclude requests
116+
# from being forwarded directly. Note that direct domains are automatically
117+
# excluded from being resigned. Special keyword 'all' matches all domains.
118+
#
119+
# The following example sends requests to *.example.com and *.google.com
120+
# directly. It would tunnel all other domains.
121+
#
122+
# --direct-domains .*\.example\.com,.*\.google\.com
123+
#direct-domains:
104124
105125
# tls-passthrough-domains [-]<regexp>,...
106126
#
107127
# Pass matching requests to their origin server without SSL/TLS re-encryption.
108-
# You can specify --tls-passthrough-domains or --tls-resign-domains, but not
109-
# both.
110-
#tls-passthrough-domains:
128+
# Requests that don't match will be re-encrypted. You can specify
129+
# --tls-passthrough-domains or --tls-resign-domains, but not both. Prefix
130+
# domains with '-' to exclude requests from being passed through. Note that
131+
# direct domains will always be passed through. Special keyword 'all' matches
132+
# all domains.
133+
#
134+
# The following example passes requests to *.example.com and *.google.com
135+
# through without SSL/TLS re-encryption.
136+
#
137+
# --tls-passthrough-domains .*\.example\.com,.*\.google\.com
138+
#tls-passthrough-domains:
111139
112140
# tls-resign-domains [-]<regexp>,...
113141
#
114142
# Resign SSL/TLS certificates for matching requests. You can specify
115-
# --tls-resign-domains or --tls-passthrough-domains, but not both.
116-
#tls-resign-domains:
143+
# --tls-resign-domains or --tls-passthrough-domains, but not both. Prefix
144+
# domains with '-' to exclude requests from being resigned. Note that direct
145+
# domains will never be resigned. Special keyword 'all' matches all domains.
146+
#
147+
# The following example resigns SSL/TLS certificates for all requests to
148+
# *.myorg.dev, except abc.myorg.dev.
149+
#
150+
# --tls-resign-domains .*\.myorg\.dev,-abc\.myorg\.dev
151+
#tls-resign-domains: [.*]
117152
118153
# tunnel-domains [-]<regexp>,...
119154
#
@@ -122,44 +157,86 @@ and their usage.
122157
# the public internet. This is the recommended option for the best performance
123158
# since it minimizes the expensive tunnelled traffic and uses it only for
124159
# internal domains that are not publicly available. You can specify
125-
# --tunnel-domains or --direct-domains, but not both.
126-
#tunnel-domains:
160+
# --tunnel-domains or --direct-domains, but not both. Prefix domains with '-' to
161+
# exclude requests from being forwarded over the SC Proxy connection. Special
162+
# keyword 'all' matches all domains.
163+
#
164+
# The following example tunnels all requests to *.myorg.dev, except
165+
# abc.myorg.com.
166+
#
167+
# --tunnel-domains .*\.myorg\.dev,-abc\.myorg\.com
168+
#tunnel-domains:
169+
170+
# --- Tunnel capacity ---
171+
172+
# tunnel-connections <count>
173+
#
174+
# Number of connections to the Sauce Connect server. By default it is set to the
175+
# number of CPUs on the machine. Total number of concurrent requests that can be
176+
# handled is limited by the number of connections multiplied by the number of
177+
# streams, see --tunnel-max-concurrent-streams flag. For example with 4
178+
# connections and 256 streams, the total number of concurrent requests is 1024.
179+
#tunnel-connections: 16
180+
181+
# tunnel-max-concurrent-streams <count>
182+
#
183+
# Maximal number of concurrent HTTP/2 streams per TCP connection.
184+
#tunnel-max-concurrent-streams: 256
127185
128186
# --- Proxy ---
129187
130188
# auth <username[:password]@host:port,...>
131189
#
132190
# Site or upstream proxy basic authentication credentials. The host and port can
133191
# be set to "*" to match all hosts and ports respectively. The flag can be
134-
# specified multiple times to add multiple credentials.
135-
#auth:
192+
# specified multiple times to add multiple credentials. Note that all the hosts
193+
# are automatically resigned as if they were passed to --tls-resign-domains
194+
# flag.
195+
#
196+
# Example:
197+
#
198+
# --proxy myproxy.org:3128 --proxy-sauce https://external.com:443 --auth
199+
200+
#auth:
136201
137202
# header <header>
138203
#
139-
# Add or remove HTTP request headers. Use the format "name: value" to add a
140-
# header, "name;" to set the header to empty value, "-name" to remove the
141-
# header, "-name*" to remove headers by prefix. The header name will be
142-
# normalized to canonical form. The header value should not contain any newlines
143-
# or carriage returns. The flag can be specified multiple times. Example: -H
144-
# "Host: example.com" -H "-User-Agent" -H "-X-*".
145-
#header:
204+
# Add or remove HTTP request headers.
205+
#
206+
# Use the format:
207+
# - name:value to add a header
208+
# - name; to set the header to empty value
209+
# - -name to remove the header
210+
# - -name* to remove headers by prefix
211+
#
212+
# The header name will be normalized to canonical form. The header value should
213+
# not contain any newlines or carriage returns. The flag can be specified
214+
# multiple times. The following example removes the User-Agent header and all
215+
# headers starting with X-.
216+
#
217+
# -H "-User-Agent" -H "-X-*"
218+
#header:
146219
147220
# pac <path or URL>
148221
#
149-
# Proxy Auto-Configuration file to use for upstream proxy selection. It can be a
150-
# local file or a URL, you can also use '-' to read from stdin. The data URI
151-
# scheme is supported, the format is data:base64,<encoded data>.
152-
#pac:
153-
154-
# proxy [protocol://]host[:port]
222+
# Proxy Auto-Configuration file to use for upstream proxy selection.
223+
#
224+
# Syntax:
225+
# - File: /path/to/file.pac
226+
# - URL: http://example.com/proxy.pac
227+
# - Embed: data:base64,<base64 encoded data>
228+
# - Stdin: -
229+
#pac:
230+
231+
# proxy <[protocol://]host:port>
155232
#
156-
# Upstream proxy to use for requests received from the Sauce Connect Server
157-
# only. The supported protocols are: http, https, socks, socks5. No protocol
158-
# specified will be interpreted as an HTTP proxy. If the port number is not
159-
# specified, it is assumed to be 1080. The basic authentication username and
160-
# password can be specified in the host string, e.g. user:pass@host:port.
161-
# Alternatively, you can specify the credentials using the -a, --auth flag.
162-
#proxy:
233+
# Upstream proxy for test sessions. It is used for requests received from the
234+
# Sauce Connect Server only. The supported protocols are: http, https, socks5.
235+
# No protocol specified will be interpreted as an HTTP proxy. The basic
236+
# authentication username and password can be specified in the host string, e.g.
237+
# user:pass@host:port. Alternatively, you can specify the credentials using the
238+
# -a, --auth flag.
239+
#proxy:
163240
164241
# proxy-localhost <allow|deny|direct>
165242
#
@@ -169,11 +246,12 @@ and their usage.
169246
# denied.
170247
#proxy-localhost: deny
171248
172-
# proxy-sauce [protocol://]host[:port]
249+
# proxy-sauce <[protocol://]host:port>
173250
#
174-
# Proxy for requests to Sauce Labs REST API and Sauce Connect servers only. See
175-
# the -x, --proxy flag for more details on the format.
176-
#proxy-sauce:
251+
# Establish a tunnel through an upstream proxy. Proxy for requests to Sauce Labs
252+
# REST API and Sauce Connect servers only. See the -x, --proxy flag for more
253+
# details on the format.
254+
#proxy-sauce:
177255
178256
# --- DNS ---
179257
@@ -190,7 +268,7 @@ and their usage.
190268
# in a list is used as primary, the rest are used as fallbacks. Round robin: the
191269
# servers are used in a round-robin fashion. The port is optional, if not
192270
# specified the default port is 53.
193-
#dns-server:
271+
#dns-server:
194272
195273
# dns-timeout <duration>
196274
#
@@ -202,17 +280,20 @@ and their usage.
202280
# cacert-file <path or base64>
203281
#
204282
# Add your own CA certificates to verify against. The system root certificates
205-
# will be used in addition to any certificates in this list. Can be a path to a
206-
# file or "data:" followed by base64 encoded certificate. Use this flag multiple
207-
# times to specify multiple CA certificate files.
208-
#cacert-file:
283+
# will be used in addition to any certificates in this list. Use this flag
284+
# multiple times to specify multiple CA certificate files.
285+
#
286+
# Syntax:
287+
# - File: /path/to/file.pac
288+
# - Embed: data:base64,<base64 encoded data>
289+
#cacert-file:
209290
210291
# http-dial-timeout <duration>
211292
#
212293
# The maximum amount of time a dial will wait for a connect to complete. With or
213294
# without a timeout, the operating system may impose its own earlier timeout.
214295
# For instance, TCP timeouts are often around 3 minutes.
215-
#http-dial-timeout: 10s
296+
#http-dial-timeout: 25s
216297
217298
# http-idle-conn-timeout <duration>
218299
#
@@ -233,33 +314,59 @@ and their usage.
233314
# limit.
234315
#http-tls-handshake-timeout: 10s
235316
317+
# http-tls-keylog-file <path>
318+
#
319+
# File to log TLS master secrets in NSS key log format. By default, the value is
320+
# taken from the SSLKEYLOGFILE environment variable. It can be used to allow
321+
# external programs such as Wireshark to decrypt TLS connections.
322+
#http-tls-keylog-file:
323+
236324
# --- API server ---
237325
238326
# api-address <host:port>
239327
#
240328
# The server address to listen on. If the host is empty, the server will listen
241329
# on all available interfaces.
242-
#api-address:
330+
#api-address:
243331
244332
# api-basic-auth <username[:password]>
245333
#
246334
# Basic authentication credentials to protect the server.
247-
#api-basic-auth:
335+
#api-basic-auth:
336+
337+
# api-idle-timeout <duration>
338+
#
339+
# The maximum amount of time to wait for the next request before closing
340+
# connection.
341+
#api-idle-timeout: 1h0m0s
248342
249343
# --- Logging ---
250344
251345
# log-file <path>
252346
#
253-
# Path to the log file, if empty, logs to stdout.
254-
#log-file:
347+
# Path to the log file, if empty, logs to stdout. The file is reopened on SIGHUP
348+
# to allow log rotation using external tools.
349+
#log-file:
255350
256-
# log-http [api|proxy|control:]<none|short-url|url|headers|body|errors>,...
351+
# log-http [api|proxy|control:]<none|short-url|url|headers|body|errors>,...
257352
#
258-
# HTTP request and response logging mode. Setting this to none disables logging.
259-
# The short-url mode logs [scheme://]host[/path] instead of the full URL. The
260-
# error mode logs request line and headers if status code is greater than or
261-
# equal to 500.
262-
#log-http:
353+
# HTTP request and response logging mode.
354+
#
355+
# Modes:
356+
# - none: no logging
357+
# - short-url: logs [scheme://]host[/path] instead of the full URL
358+
# - url: logs the full URL including query parameters
359+
# - headers: logs request line and headers
360+
# - body: logs request line, headers, and body
361+
# - errors: logs request line and headers if status code is greater than or
362+
# equal to 500
363+
#
364+
# Modes for different modules can be specified separated by commas. The
365+
# following example specifies that the API module logs errors, the proxy module
366+
# logs headers, and anything else logs full URL.
367+
#
368+
# --log-http=api:errors,proxy:headers,url
369+
#log-http: none
263370
264371
# log-level <error|info|debug>
265372
#
@@ -385,16 +492,6 @@ You can persist Sauce Connect Proxy environment variables by adding them to one
385492
</TabItem>
386493
</Tabs>
387494

388-
## Configuring Mobile Devices for testing `localhost` {#sc5localhost}
389-
390-
Testing with the address `localhost` (or the IP address `127.0.0.1`) is not supported with iOS or Android real devices in Sauce Connect.
391-
392-
To work around this, you'll need to edit your `hosts` file on the machine on which you are running Sauce Connect. Add an entry for a placeholder hostname (such as `localtestsite`) and the IP address `127.0.0.1`. Requests for `localtestsite` in your tests will then be sent through your Sauce Connect tunnel to `localhost`, which is the machine on which you are running Sauce Connect.
393-
394-
For example, adding `127.0.0.1 mockserver` to your `/etc/hosts` file, then starting a server on `localhost:3333` will route mockserver:3333 HTTP calls to your local server. Mobile tests using Sauce Connect will then be able to find your local server regardless of the nature of your test.
395-
396-
For tips on how to edit your `hosts` file, see [How to Edit Hosts File in Linux, Windows, or Mac](https://phoenixnap.com/kb/how-to-edit-hosts-file-in-windows-mac-or-linux).
397-
398495
## More Information
399496

400497
- [Sauce Connect Proxy Quickstart](/secure-connections/sauce-connect-5/quickstart)

0 commit comments

Comments
 (0)