Skip to main content

Install the proxy

The proxy is a Node.js application and runs on both Windows and Linux. For production use it is registered as a service, so it starts automatically and restarts on failure: a Windows service on Windows, or a systemd service on Linux.

Prerequisites

  • A machine inside your network with access to the systems you want to reach. For the default pull transport mode, outbound HTTPS access to the automator is enough; for the push transport mode, the automator must be able to reach this machine over HTTPS.
  • Node.js 22 or later installed on that machine.
  • The proxy distribution, provided by techwork. Register a request with us to obtain the latest version or to upgrade an existing installation.

Install the dependencies

From the proxy directory, install the application dependencies:

npm install

On Windows, also install the node-windows package, which is needed to register the service:

npm install node-windows

node-windows must be installed locally, without --save.

Configure the proxy

Copy conf.json.sample to conf.json and configure at least one profile. On Windows, also copy service_config.json.sample to service_config.json and adjust the service name and port. All options are described in the configuration reference.

Script-mode profiles need a 256-bit encryption key. Generate one with:

node bin/secret

Register the Windows service

Register the proxy as a Windows service. This uses service_config.json if present; otherwise the defaults apply:

node service_install.js

To run multiple proxy instances on one machine, give each its own configuration file and pass the path during installation:

node service_install.js path/to/other_config.json

Register the systemd service (Linux)

On Linux, service_config.json is not used. Create a systemd unit instead, for example /etc/systemd/system/automator-proxy.service:

[Unit]
Description=techwork automator proxy
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/bin/node /opt/automator-proxy/execproxyserver.js
Restart=always
RestartSec=5
User=automator-proxy

[Install]
WantedBy=multi-user.target

Adjust the paths and the user to your installation, then enable and start the service:

systemctl daemon-reload
systemctl enable --now automator-proxy

The HTTP server settings that service_config.json provides on Windows are read from environment variables on Linux: PORT, ROUTE_PREFIX, SSL_KEY_PATH and SSL_CERT_PATH, set with Environment= lines in the unit file. With the pull transport mode the automator never connects to the proxy, so none of them are needed.

Verify the installation

After registering the service, use Verify on the Proxy account form in the automator to confirm that the automator and the proxy can reach each other and that the token and key match. Alternatively, start the proxy in the foreground to watch its output directly:

node execproxyserver.js

Deregister the Windows service

To stop and remove the service:

node service_remove.js

Or, when the service was installed with a custom configuration file, pass the same path so the service name matches:

node service_remove.js path/to/other_config.json

Deregister the systemd service (Linux)

Stop and disable the service, then remove the unit file:

systemctl disable --now automator-proxy
rm /etc/systemd/system/automator-proxy.service
systemctl daemon-reload