...
HTTP-compatible Snap Packs can use an HTTP proxy configured in the Node Proxies configuration tab of a Snaplex within in SnapLogic Manager. However, the Script Snap allows you to write scripts that call external processes (for example, curl
), and these scripts are not aware of proxy configurations within in the SnapLogic application.
You can use curl
to configure a proxy directly via the --proxy
argument. To enforce proxy usage across all usages of the Script Snap, set the http_proxy
and/or https_proxy
environment variables within the folIn this Articlelowing file:.
Environment variables declared within in the /etc/sysconfig/jcc
file are visible to the Snaplex application (OS-level environment variables are not visible). If the /etc/sysconfig
directory and /etc/sysconfig/jcc
file do not exist in your Snaplex, run the following command with your own username/password
(if authentication is required), proxy-ip-address
, and port
(you could also add https_proxy
) to create them:
|
After the file and its directory are created, run one of the following commands to restart the Snaplex application:
|
The http_proxy
/https_proxy
environment variable is now active within in the SnapLogic product. You can now run your script to call the external process.
For example, the following Script Snap uses the subprocess
library to execute curl
and adds the response body to the output document.:
|
On execution, the proxy access log shows the request being routed through the proxy.
...
To increase this limit, change the default of 20 to a higher value . In the etc/global.properties
by adding it to in the Update Snaplex dialog, Node Properties tab, Global properties table:
|