From 113655cc6e48d1ead4e32100ca20ee3090e8e5e8 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Mon, 13 Mar 2023 08:55:57 +0300 Subject: [PATCH 1/2] Improve ProxyAgent example with autentification --- docs/api/ProxyAgent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/ProxyAgent.md b/docs/api/ProxyAgent.md index 05d67a094cf..3ddd4e7348f 100644 --- a/docs/api/ProxyAgent.md +++ b/docs/api/ProxyAgent.md @@ -83,7 +83,7 @@ import { setGlobalDispatcher, request, ProxyAgent } from 'undici'; const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server', - token: 'Bearer xxxx' + token: `Basic ${Buffer.from('username:password').toString('base64')}` }); setGlobalDispatcher(proxyAgent); From 8058f88ec980f172dc985e04df843a2e0b79af08 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Mon, 13 Mar 2023 12:23:11 +0300 Subject: [PATCH 2/2] return previous example as comment --- docs/api/ProxyAgent.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api/ProxyAgent.md b/docs/api/ProxyAgent.md index 3ddd4e7348f..b18382f2628 100644 --- a/docs/api/ProxyAgent.md +++ b/docs/api/ProxyAgent.md @@ -83,6 +83,7 @@ import { setGlobalDispatcher, request, ProxyAgent } from 'undici'; const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server', + // token: 'Bearer xxxx' token: `Basic ${Buffer.from('username:password').toString('base64')}` }); setGlobalDispatcher(proxyAgent);