Skip to main content

How to Use Proxidize With Node.js and Undici

Connect Proxidize to Node.js with Undici's ProxyAgent, separate proxy credentials, and a verified HTTP or HTTPS access point.

How to Use Proxidize With Node.js and Undici

Configure Node.js and Undici for Proxidize

Undici is a production HTTP client for Node.js. Its ProxyAgent applies one Proxidize route to the requests dispatched through that agent while keeping proxy authentication separate from the destination URL.

Keep the endpoint and credentials in environment variables. Use the exact HTTP or HTTPS scheme shown in the Proxidize dashboard.

bash

Run the Integration

Install the pinned client used by the repository example.

Undici ProxyAgent

Create the authentication token from environment variables and pass the agent only to requests that should use Proxidize.

javascript

Control Sessions and Rotation

Create one agent per intended proxy route or session boundary. Reuse it for related requests, close it when that worker finishes, and create a new agent after changing the access point or session identifier.

Use a sticky session when related requests must keep the same temporary network identity. Use rotation for independent requests, and rotate only at an intentional workflow boundary. Cookies, browser storage, and application state should change with the proxy identity rather than halfway through a stateful task.

Verify the Proxied Network Path

Run the IP-check example through the same client or browser context that will perform the permitted workload. A successful request from another terminal or library does not prove that this integration uses the same proxy route.

The repository example prints a redacted endpoint and the visible exit IP. It does not print the username or password. Confirm the intended US mobile or residential profile before using an approved target.

Troubleshoot Common Failures

  • A 407 response means the proxy rejected or did not receive valid authentication.
  • A TLS error can come from either the proxy connection or destination connection; do not disable verification as a permanent fix.
  • Using ordinary fetch without the configured dispatcher sends that request outside this proxy path.

Test in layers: first verify the endpoint and credentials, then the IP-check URL, and only then the intended destination. Keep TLS verification enabled and treat repeated timeouts separately from authentication failures.

Production Checklist

  • Keep credentials in environment variables or a secrets manager.
  • Match one sticky session to one stateful worker or browser context.
  • Bound concurrency, retries, queue length, and request rate.
  • Redact proxy credentials from exceptions, traces, and logs.
  • Verify the exit location and protocol before scaling.
  • Follow applicable laws, third-party terms, and destination rules.

FAQ

Integration FAQs

Common questions about using Proxidize with Node.js and Undici.

No. Node.js and Undici connects through standard proxy settings, so the Proxidize endpoint and authentication values can be passed directly to the supported client configuration.

Yes, when the selected access point supports the required protocol. Use residential proxies for broad geographic coverage and US mobile proxies when the workflow specifically requires mobile-network identity.

Reuse one ProxyAgent for a sticky workflow. Create a new agent after changing the intended session or endpoint for independent work.

Request an IP-check endpoint through the same client, crawler, or browser context, then compare the visible exit with the machine's direct public IP.

Store them in environment variables or a secrets manager. Do not embed credentials in the request URL, source code, test fixture, or application log.

Keep Going

Other Proxidize integrations

See all Proxidize integrations →

Ready to run on clean proxies?

Start free today, or talk to our team to build a plan around your scale.

KYC required to start