Set up a proxy user
- Log in to the client area, open My Services and click your server. Scroll to Use your IP from code, n8n, CI or a browser. Under Add a proxy user, type
nodeand click Add.
You should see: a new card namedapp-node. Names can use letters and digits only, and MazeVPN adds theapp-prefix. - On that card, click Copy next to HTTPS proxy (marked Encrypted). The copied URL contains the password, so paste it only into a secret or environment variable, never into code.
The card of a new proxy user. The eye icon shows the password; Copy copies the full URL with the password. (Server IP replaced with an example.) You should see: a URL likehttps://app-node:…@203.0.113.42:443, where the address is your server’s IP. - Install the libraries. Store the HTTPS proxy URL in MAZE_PROXY_URL. Pick package releases compatible with your Node version.
npm install undici axios https-proxy-agentYou should see: The three modules install. The example URL format is https://app-node:PASSWORD@203.0.113.42:443.
Fetch: use a dispatcher
Node’s global fetch is available starting in Node 18. It has no proxy URL option in the fetch request settings. Pass an Undici dispatcher on Node versions that support it. Check the installed Undici release’s engine requirements separately.
For an HTTPS proxy addressed by IP, the MazeVPN example uses a placeholder TLS server name and explicitly verifies the proxy certificate against the actual IP. Normal certificate chain verification still applies. A hostname-based proxy uses the normal TLS path.
// fetch-check.mjs
import { isIP } from 'node:net';
import { checkServerIdentity } from 'node:tls';
import { Agent, ProxyAgent } from 'undici';
const url = 'https://api.ipify.org';
const proxy = new URL(process.env.MAZE_PROXY_URL);
const host = proxy.hostname.replace(/^\[|\]$/g, '');
const proxyTls = proxy.protocol === 'https:' && isIP(host)
? { servername: 'proxy.invalid',
checkServerIdentity: (_name, cert) => checkServerIdentity(host, cert) }
: undefined;
const direct = new Agent();
const proxied = new ProxyAgent({ uri: proxy.href, proxyTls });
try {
for (const [label, dispatcher] of [['direct', direct], ['proxy', proxied]]) {
const r = await fetch(url, { dispatcher, signal: AbortSignal.timeout(15_000) });
if (!r.ok) throw new Error('IP check failed: ' + r.status);
console.log(label, (await r.text()).trim());
}
} finally {
await direct.close();
await proxied.close();
}Axios: use an HTTPS proxy agent
Keep the request on Axios’s Node HTTP adapter when supplying httpsAgent. Set proxy: false to let that agent own the proxy connection. Use an Axios timeout and close the agent when the script exits.
// axios-check.mjs
import axios from 'axios';
import { isIP } from 'node:net';
import { checkServerIdentity } from 'node:tls';
import { HttpsProxyAgent } from 'https-proxy-agent';
const proxy = new URL(process.env.MAZE_PROXY_URL);
const host = proxy.hostname.replace(/^\[|\]$/g, '');
const options = proxy.protocol === 'https:' && isIP(host)
? { servername: 'proxy.invalid',
checkServerIdentity: (_name, cert) => checkServerIdentity(host, cert) }
: {};
const httpsAgent = new HttpsProxyAgent(proxy, options);
try {
const { data } = await axios.get('https://api.ipify.org', {
adapter: 'http', httpsAgent, proxy: false, timeout: 15_000,
});
console.log(String(data).trim());
} finally {
httpsAgent.destroy();
}Verify from the runtime that will make the real request
In a November 24, 2026 test with Node.js 26.13.0, direct fetch returned the machine’s IPv4. Fetch through Undici and Axios through the HTTPS proxy agent both returned the QA server’s IPv4.
- Run both files from the Node environment that sends the allowlisted requests.
node fetch-check.mjs node axios-check.mjsYou should see: The direct check shows your machine’s IP. Both proxied checks show your proxy server’s IP.
Official references
- Node.js fetch and custom dispatchers
- Node.js certificate identity checks
- Undici ProxyAgent
- Axios request configuration
- https-proxy-agent package documentation
Skip the setup
A dedicated IPv4 in 38 cities, usually ready about 3 minutes after payment. Connect devices with WireGuard and apps with an authenticated HTTPS, HTTP, or SOCKS5 proxy. From $9.99/month.