Parses a string to check if it is a valid URL.
a string with a URL
a URL instance or undefined if not a valid url.
Parses environment variables valid for http requests.
string
if valid variable is found or undefined.
Parses environment variables valid for https requests.
string
if valid variable is found or undefined.
Parses environment variables valid for no proxy exceptions.
string[]
of all hostnames found in the comma separated list
in lowercase without white spaces.
Retrieve an appropriate http.agent instance if proxy environment variables can be found.
Zowe ISession
containing the hostname for the http request.
Uses the session's rejectUnauthorized
also for the proxy connection.
an instance of an appropriate subclass of node's https.agent if proxy
settings were found. Returns undefined
if no proxy settings are found.
Parses environment variables for proxy servers.
Zowe ISession
containing the hostname for the http request.
instance of private ProxySetting
or undefined
Returns the URL to the proxy server if proxy environment variables can be found. Can be used for testing the settings and logging connection details.
Zowe ISession
containing the hostname for the http request.
URL
to proxy server
If the NO_PROXY or no_proxy environment variables are set with a comma separated
list of hostnames it will try to match the hostname of the Zowe ISession
and
return true
if found. Performs a simple string compare ignoring casing and white
spaces, but will not resolve hostnames to ip addressees and not perform wildcard matching.
Zowe ISession
containing the hostname for the http request.
true
if the Zowe session host matches an entry in the comma separated
list of hostnames in the environment variable. false
otherwise.
Generated using TypeDoc
Utility class to provide an http agent to REST APIs that is configured for a proxy server based on commonly used environment variables.
Supports the usage of the environment variables HTTP_PROXY, http_proxy, HTTPS_PROXY, https_proxy. If any of these env variables is set and depending how the Zowe session is configured for http or https it instantiates an appropriate http agent utilizing a popular third party library. If the z/OS system uses self-signed certificates then the proxy server must be configured to accept them. If the proxy server itself is configured with self-signed certificates then the user needs to either import these certificates on their workstation, use rejectUnauthorized in their Zowe profile, or use the (not recommended) nodejs variable NODE_TLS_REJECT_UNAUTHORIZED=0. This class also looks for the environment variables NO_PROXY or no_proxy. These work with a simple comma separated list of hostnames that need to match with the hostname of the Zowe profile.