On this page:
You can use the instructions in Install the Node.js Agent to install the Node.js Agent on Node.js applications running on Windows. However, there are a few additional considerations that apply to Windows environments, as described here.
Depending on your Node.js environment on Windows, you may need to configure three ports in the Node.js require statement. These port settings are:
All three ports must be in the range 1024-65535 inclusive.
The default behavior is for the Agent to auto-launch the proxy (proxyAutolaunchDisabled is false).
If you allow the Agent to auto-launch, and you have one Node.js process per machine, the Agent will automatically use the default port values if they are available. In this case, you do not have to configure these settings. If the default ports are not available, in the require statement, you must configure these settings to ports that are available.
If you have multiple Node.js processes on a single machine each reporting to its own proxy, each process needs its own set of ports. In this case, in the require statement for each process, configure unique settings for all three ports.
Some environments have multiple Node.js processes on the same machine, all reporting to a single proxy. In these environments it is necessary to launch the proxy manually (proxyAutolaunchDisabled is true) and to configure the three port settings.
The proxyCommPort setting in the require statement and the commPort option to the runProxy.cmd must be the same value. The agent and the proxy must use the same port.
The proxyRequestPort and the proxyReportingPort are two unused TCP ports that the user running the proxy has permission to bind to on Windows.
Each distinct app-tier-node combination on a single machine must use different request and reporting ports. Two processes reporting as the same app-tier-node may use the same request and reporting ports. Set these ports in the require statement for each app-tier-node combination.
By default, the proxy component is automatically started when you start the agent. Use the command described here only if you have configured the agent for manual proxy launch.
Before any traffic is run on the instrumented server, execute runProxy.cmd to start the proxy using the following syntax. If you use the optional -d option, it must precede the -j option.
Usage: runProxy.cmd [-d <proxyDir>] -j <jreDir> [logDir] [commPort] Options: -d <proxyDir> the directory where the proxy is installed; optional, defaults to the directory containing the runProxy.cmd script -j <jreDir> the directory where the JRE is installed; required logDir the directory the proxy should log to; optional, defaults to <proxyDir>\logs [commPort] port used for the proxy control channel on Windows; defaults to 10101; if specified it must match the proxyCommPort setting in the require statement
This example assumes that the command is run from the root of the Node.js application instrumented by the agent.
.\node_modules\appdynamics\node_modules\appdynamics-proxy\proxy\runProxy.cmd -j .\node_modules\appdynamics\node_modules\appdynamics-jre\jre /var/log/proxy .\node_modules\appdynamics\node_modules\appdynamics-proxy\proxy\logs 10101
You can schedule the runProxy command in the Windows Task Scheduler.
-d <app_root>/node_modules/appdynamics-proxy -j <app_root>/node_modules/appdynamics-jre/jre %TEMP% 10101