Skip to content

Commit

Permalink
Improve ProxyAgent example with autentication (nodejs#2004)
Browse files Browse the repository at this point in the history
* Improve ProxyAgent example with autentification

* return previous example as comment
  • Loading branch information
egmen authored and crysmags committed Feb 27, 2024
1 parent 472cae0 commit c0b67c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/api/ProxyAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ import { setGlobalDispatcher, request, ProxyAgent } from 'undici';

const proxyAgent = new ProxyAgent({
uri: 'my.proxy.server',
token: 'Bearer xxxx'
// token: 'Bearer xxxx'
token: `Basic ${Buffer.from('username:password').toString('base64')}`
});
setGlobalDispatcher(proxyAgent);

Expand Down

0 comments on commit c0b67c7

Please sign in to comment.