-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not use http proxy on node 20 #120
Comments
Same here. I can't download template in |
The solution provided is useful, set FORCE_NODE_FETCH=1 for powershell, as follows: |
8 tasks
Proxy support is added in the latest version of giget for Node.js versions with native fetch (undici) (read more) You can get the feature by upgrading your lockfile. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
node 20.6.1
giget 1.1.3
Reproduction
Start any proxy server with logging:
Set environment variable
Run
curl -x http://127.0.0.1:9191 https://example.com
to confirm the proxy is working and is printing proxy connections:Run
npx giget github:withastro/astro/examples/basics#latest ./output --force-clean --verbose
.No connection is made through the proxy.
Describe the bug
giget should use the proxy set in environment variable.
https://github.com/unjs/node-fetch-native/blob/47e92fdae1356d3970e40dfafa5614d2c0f68a87/src/index.ts#L22-L29
giget by default is using node's built in
fetch
in node 20.The built-in
fetch
is the same asundici.fetch
.https://github.com/nodejs/node/blob/3e14cfbbcfcedbb18235ffd5cc28983ac5d5ca52/lib/internal/process/pre_execution.js#L314-L316
undici does not support
http.Agent
but uses a different API: https://undici.nodejs.org/#/docs/api/ProxyAgentAdditional context
Workaround: set the environment variable
FORCE_NODE_FETCH
.Logs
No response
The text was updated successfully, but these errors were encountered: