zed icon indicating copy to clipboard operation
zed copied to clipboard

Add a `http_proxy` setting

Open TENX-S opened this issue 2 years ago • 4 comments
trafficstars

Check for existing issues

  • [X] Completed

Describe the feature

FYI, programmers in China face restrictions from the Great Firewall(GFW) and require a VPN service to access the internet freely. When I launch Zed, it automatically downloads the LSP server, which is blocked by the GFW and fails to complete. Therefore, I need to set the http_proxy env variable in a terminal session and open Zed using the CLI.

It would be very helpful if there were settings related to http_proxy. Take VS Code as an example:

image

If applicable, add mockups / screenshots to help present your vision of the feature

No response

TENX-S avatar Jan 23 '23 16:01 TENX-S

This project uses isahc = { version = "1.7.2", default-features = false, features = ["static-curl", "text-decoding"] } which respects both https_proxy and http_proxy. To let the app be aware of this, you should follow the macOS mechanism by setting env like this:

launchctl setenv https_proxy http://address
launchctl setenv http_proxy http://address

Now you can access the Internet.

Additional

I found this to be a quick helpful reference to explicitly tell isahc what proxy to use: https://github.com/sagebind/isahc/pull/167/files.

Banyc avatar Jan 25 '24 07:01 Banyc

try to start zed with command line:

cd /Applications/Zed.app/Contents/MacOS
export http_proxy=xxx
export https_proxy=yyy
zed

smallfish avatar Jan 28 '24 07:01 smallfish

It doesn't seems to work with OpenAI API, is there any recommended way to use a proxy with OpenAI API ?

seven1240 avatar Feb 26 '24 01:02 seven1240

i am using zed behind proxy, tired all workarounds above does not solve my issue, assistant still nothing response,

crazybits avatar Apr 24 '24 01:04 crazybits