The command-line tool, or CLI binary, for SmartBear SecureTunnel enables users to start a local connection on the command line or programmatically from the shell.
Other resources you may want to review before using the CLI.
This command line version uses WSS (secure websockets over https, port 443) to create the local connection.
All requests to start a tunnel require username and authkey via the command line options.
./SBSecureTunnel --username USERNAME --authkey AUTHKEY
Note: Credential flags may also be set as environment variables beginning with SMARTBEAR.
e.g. Instead of typing –username, you may instead set the environment variable
SMARTBEAR_USERNAME to the desired username.
This is the most basic type of tunnel for a local connection. It creates an encrypted tunnel that allows traffic and requests to be routed through the local network of your computer. This allows you to test sites that are only accessible through your local network or behind your firewall.
Local HTML Files
This type of tunnel allows you to test static HTML files saved on your computer without being required to setup a web server.
./SBSecureTunnel --dir "/Path/To/Local/Directory"
This connection type allows you to specify a proxy server to route your traffic through during tests.
./SBSecureTunnel --proxyIp PROXYIP --proxyPort PROXYPORT
./SBSecureTunnel --proxyIp PROXYIP --proxyPort PROXYPORT --proxyUser username --proxyPass password
Via Proxy Auto-Config File:
./SBSecureTunnel --pac /PATH/TO/FILE
Via Proxy Auto-Config Url:
./SBSecureTunnel --pac https://domain.com/proxy-config-file
In lieu of specifying a single proxy server, you may provide a proxy auto-config (PAC) file.
Each request made through your local machine will follow the routing directives listed in
the PAC. If the HTTP_PROXY or HTTPS_PROXY options listed below are employed, they will take
precedence in routing the connection from your local machine to Smartbear. It does
not make sense to use the above Proxy Server option alongside the PAC file option, but in the
case that you do, the Proxy Server option will take precedence. You may specify a path to a
file or a URL.
There are some cases where multiple tunnels might be necessary, such as when working with multiple
development environments. In this case, we provide the option to name tunnels so that they may be
specifically selected for use in various tests: in the Advanced Options in the UI, or by specifying
the property “tunnel_name” in the JSON sent to the API.
./SBSecureTunnel --tunnelname TUNNELNAME
Some corporations use an HTTP proxy for all outbound web traffic. The Smartbear tunnel communicates via wss
over port 443 to Smartbear’s servers to initiate a local connection. If you have an HTTP proxy that it must
route through, use this option to do so. It works by temporarily setting the HTTP_PROXY environment variable, so may be redundant in cases wherein it is already set.
./SBSecureTunnel --httpProxy HTTPPROXY
Usage with basic authentication:
./SBSecureTunnel --httpProxy PROXYUSER:PROXYPASS@HTTPPROXY
Has the same functionality as HTTP_PROXY but sets the HTTPS_PROXY environment variable instead.
./SBSecureTunnel --httpsProxy HTTPSPROXY
Usage with basic authentication:
./SBSecureTunnel --httpsProxy PROXYUSER:PROXYPASS@HTTPSPROXY
BYPASS PUBLIC HOSTS:
Specify whether public-resolvable URLs should resolve bypass the tunnel (default/true behavior) or route through
the tunnel (false behavior).
./SBSecureTunnel --bypass false
ACCEPT ALL CERTIFICATES:
Set up the tunnel to work with sites with invalid (self-signed, expired) certificates.
Useful for testing sites that present with certificate errors in a browser.
REJECT UNAUTHORIZED SSL CERTIFICATES:
Enable or disable SSL certificate checking in Node itself. Useful if a self-signed certificate
is in the chain (i.e., on a proxy), but only works in narrow cases.
./SBSecureTunnel --rejectUnauthorized false
The kill file option allows you specify the name of a ‘kill file’ that if placed in the current
directory will cause the program to gracefully shutdown.
./SBSecureTunnel --kill KILLFILENAME
When the tunnel is up-and-running, an empty file will be placed in the path specified by the user.
./SBSecureTunnel --ready READYFILENAME
Specifying this flag enables verbose mode; you’ll see most of the traffic handling.
Specifying this flag disables most output.