This results in GithubDownloader being very slow in China Mainland without a proper proxy! I can now only get it download through Cloudflare WARP (as it creates a virtual network interface directly).
A working example is to add a dispatcher on fetch:
import {ProxyAgent} from 'undici';
(async () => {
const res = await fetch('https://api.ipify.org?format=json', {
dispatcher: new ProxyAgent('http://127.0.0.1:16619')
});
const data = await res.json();
// shows my proxy server's IP
console.log(data);
})();
See https://stackoverflow.com/questions/72534539/node-js-18-3-native-fetch-request-with-a-proxy
Also: node-fetch/node-fetch#195
This results in
GithubDownloaderbeing very slow in China Mainland without a proper proxy! I can now only get it download through Cloudflare WARP (as it creates a virtual network interface directly).A working example is to add a dispatcher on
fetch:See https://stackoverflow.com/questions/72534539/node-js-18-3-native-fetch-request-with-a-proxy
Also: node-fetch/node-fetch#195