Node.js
Node.js is fully supported by Speedscale, but proxy behavior depends on the HTTP client library. Use this page for Node-specific proxy settings, TLS trust configuration, demo guidance, and the Proxymock local workflow.
- Support matrix: Technology Support
- Shared Proxymock proxy reference: Language Configuration
Kubernetes Sidecar
When Node.js runs with the Speedscale sidecar in forward or dual mode, sidecar injection alone is not
enough for outbound capture. The Node runtime or client library must still use the sidecar's forward proxy on
127.0.0.1:4140.
For many apps this starts with:
export HTTP_PROXY=http://127.0.0.1:4140
export HTTPS_PROXY=http://127.0.0.1:4140
Some Node.js HTTP clients ignore those variables unless you also configure an agent or library-specific proxy
setting. If tls-out is enabled, also trust the Speedscale CA with NODE_EXTRA_CA_CERTS.
See Proxy Modes and TLS Support for the shared sidecar behavior.
Demo App
- Public demo: speedscale/demo (
nodedirectory) - Stack: Express
- Local run:
npm install && npm start - Quick validation:
curl http://localhost:3000/
This is the current public Node.js demo used for local Proxymock examples.
Proxymock
Use this path for the fastest Node.js first success on a developer workstation.
- 1. Install and initialize Proxymock
brew install speedscale/tap/proxymock proxymock initUse browser sign-in by default. Use `proxymock init --api-key <your key>` only for CI or other headless environments.
- 2. Start recording
git clone https://github.com/speedscale/demo cd demo/node proxymock record --app-port 3000 --out ./proxymock/recordedThe app listens on port 3000 while proxymock records inbound traffic on 4143 and saves the capture in `./proxymock/recorded`.
- 3. Route traffic through the proxy and run the app
cd demo/node export HTTP_PROXY=http://127.0.0.1:4140 export HTTPS_PROXY=http://127.0.0.1:4140 npm install npm startMany Node HTTP clients need explicit proxy support, so set the environment variables and client agent together when needed.
- 4. Generate one real workflow
curl http://localhost:4143/ curl http://localhost:4143/nasa curl http://localhost:4143/events curl http://localhost:4143/binExercise the demo endpoints once so the recording reflects the real outbound calls.
- 5. Stop the recording, then run with mocks
cd demo/node proxymock mock --in ./proxymock/recorded export HTTP_PROXY=http://127.0.0.1:4140 export HTTPS_PROXY=http://127.0.0.1:4140 npm startThe mocked run should no longer need live downstream access.
- 6. Replay the same traffic against a change
cd demo/node proxymock replay --in ./proxymock/recorded --test-against http://localhost:3000Use replay as the regression check before shipping Node.js changes.
TLS Trust
Node.js usually respects NODE_EXTRA_CA_CERTS. For the exact command and client-specific caveats, use the shared Language Configuration page.