bun icon indicating copy to clipboard operation
bun copied to clipboard

Support `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY`

Open Electroid opened this issue 3 years ago • 1 comments

Developers sometimes need to configure a proxy when using Bun.

  • #49
  • #565

While Node.js has decided not to support this, these variables have been adopted by curl, wget, Ruby, Python, Go, etc. There is a comprehensive blog post by Gitlab that explains how each of these variables should work.

Electroid avatar Nov 01 '22 18:11 Electroid

@cirospaciari is working on this

Jarred-Sumner avatar Jan 11 '23 16:01 Jarred-Sumner

@cirospaciari has shipped this

Jarred-Sumner avatar Jan 30 '23 21:01 Jarred-Sumner

http_proxy and https_proxy don't seem to work for me for bun install and bun upgrade. I tried the capitalized variants too. Is this confirmed to be working?

For comparison, my proxy works with npm install, yarn install, and pnpm install.

jylin avatar Oct 19 '23 02:10 jylin

Confirmed not working with proxy at my end. @jylin is that still the issue for you?

totaland avatar Nov 27 '23 22:11 totaland

Yea I don't think it works. bun install I can get around by using a different registry, but it would be nice if bun upgrade understood http proxy environment variables.

jylin avatar Nov 27 '23 22:11 jylin

Hi, I am using Bun v1.0.31 on Windows 11 with CMD, Git Bash, and pwsh but seems like all of them can't do bun install under proxy connection. I am not using WSL or Docker. Not installed Node.js. I've already set and using proxy configuration and it works fine with git, composer, curl, etc.

Does this feature still not implemented for windows ?

Below is my bun install --verbose result when tried to install fresh Laravel dependencies.

Verbose log

[0.00ms] ".env" bun install v1.0.31-canary.2 (8c5ac061) Enqueue package manifest for download: @tailwindcss/forms Enqueue package manifest for download: alpinejs Enqueue package manifest for download: autoprefixer Enqueue package manifest for download: axios Enqueue package manifest for download: laravel-vite-plugin Enqueue package manifest for download: postcss Enqueue package manifest for download: tailwindcss Enqueue package manifest for download: vite 🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks Request: GET /@tailwindcss%2fforms Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /alpinejs Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /autoprefixer Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /axios Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /laravel-vite-plugin Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /postcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /tailwindcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /vite Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /@tailwindcss%2fforms Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /autoprefixer Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /laravel-vite-plugin Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /axios Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /alpinejs Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /postcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /tailwindcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /vite Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /@tailwindcss%2fforms Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /autoprefixer Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /axios Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /laravel-vite-plugin Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /postcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /alpinejs Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /tailwindcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /vite Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /autoprefixer Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /laravel-vite-plugin Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /axios Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /@tailwindcss%2fforms Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /alpinejs Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /tailwindcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /postcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /vite Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /autoprefixer Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /axios Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /laravel-vite-plugin Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /@tailwindcss%2fforms Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /postcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /vite Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /alpinejs Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /tailwindcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /laravel-vite-plugin Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /axios Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /autoprefixer Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /@tailwindcss%2fforms Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

🔍 laravel-vite-plugin [41/48] error: Syscall downloading package manifest laravel-vite-plugin Response: < 200 Connection established

🔍 @tailwindcss/forms [42/48] error: Syscall downloading package manifest @tailwindcss/forms Response: < 200 Connection established

🔍 autoprefixer [43/48] error: Syscall downloading package manifest autoprefixer Request: GET /alpinejs Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

🔍 axios [44/48] error: Syscall downloading package manifest axios Request: GET /vite Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /postcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Request: GET /tailwindcss Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.0.31 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

🔍 vite [45/48] Response: < 200 Connection established

error: Syscall downloading package manifest vite 🔍 alpinejs [46/48] error: Syscall downloading package manifest alpinejs Response: < 200 Connection established

🔍 tailwindcss [47/48] error: Syscall downloading package manifest tailwindcss Response: < 200 Connection established

🔍 postcss [48/48] error: Syscall downloading package manifest postcss warn: Syscall downloading package manifest @tailwindcss/forms

warn: Syscall downloading package manifest autoprefixer

warn: Syscall downloading package manifest laravel-vite-plugin

warn: Syscall downloading package manifest axios

warn: Syscall downloading package manifest alpinejs

warn: Syscall downloading package manifest postcss

warn: Syscall downloading package manifest tailwindcss

warn: Syscall downloading package manifest vite

warn: Syscall downloading package manifest @tailwindcss/forms

warn: Syscall downloading package manifest autoprefixer

warn: Syscall downloading package manifest axios

warn: Syscall downloading package manifest laravel-vite-plugin

warn: Syscall downloading package manifest postcss

warn: Syscall downloading package manifest alpinejs

warn: Syscall downloading package manifest tailwindcss

warn: Syscall downloading package manifest vite

warn: Syscall downloading package manifest autoprefixer

warn: Syscall downloading package manifest laravel-vite-plugin

warn: Syscall downloading package manifest axios

warn: Syscall downloading package manifest @tailwindcss/forms

warn: Syscall downloading package manifest alpinejs

warn: Syscall downloading package manifest tailwindcss

warn: Syscall downloading package manifest postcss

warn: Syscall downloading package manifest vite

warn: Syscall downloading package manifest autoprefixer

warn: Syscall downloading package manifest axios

warn: Syscall downloading package manifest laravel-vite-plugin

warn: Syscall downloading package manifest @tailwindcss/forms

warn: Syscall downloading package manifest postcss

warn: Syscall downloading package manifest vite

warn: Syscall downloading package manifest alpinejs

warn: Syscall downloading package manifest tailwindcss

warn: Syscall downloading package manifest laravel-vite-plugin

warn: Syscall downloading package manifest axios

warn: Syscall downloading package manifest autoprefixer

warn: Syscall downloading package manifest @tailwindcss/forms

warn: Syscall downloading package manifest alpinejs

warn: Syscall downloading package manifest vite

warn: Syscall downloading package manifest postcss

warn: Syscall downloading package manifest tailwindcss error: @tailwindcss/forms@^0.5.2 failed to resolve error: alpinejs@^3.4.2 failed to resolve error: autoprefixer@^10.4.2 failed to resolve error: axios@^1.6.4 failed to resolve error: laravel-vite-plugin@^1.0 failed to resolve error: postcss@^8.4.31 failed to resolve error: tailwindcss@^3.1.0 failed to resolve error: vite@^5.0 failed to resolve

wahyusa avatar Mar 16 '24 03:03 wahyusa

same here on macOS, with https_proxy

clouds56 avatar Apr 16 '24 20:04 clouds56

@cirospaciari @Jarred-Sumner any update on this?

totaland avatar Apr 17 '24 02:04 totaland

@Electroid , @cirospaciari please reopen this, still not working

seyfu-t avatar Jun 27 '24 08:06 seyfu-t

@seyfu-t can you open a new issue that includes a reproduction? HTTP_PROXY and HTTPS_PROXY do work and have unit tests to verify this, so we're going to need to see more specifically what's not working in order to fix it

Jarred-Sumner avatar Jun 27 '24 08:06 Jarred-Sumner