j178 / chatgpt

An elegant interactive CLI for ChatGPT
693 stars 52 forks source link

not using `http_proxy`, `https_proxy` env var on windows #53

Closed baymax55 closed 1 year ago

baymax55 commented 1 year ago

image

baymax55 commented 1 year ago

error: Post "https://api.openai.com/v1/chat/completions": dial tcp 111.243.214.169:443: connectex: A connection attempt

baymax55 commented 1 year ago

when I use 'set http_proxy=http://172.16.11.11:7890 set https_proxy=http://172.16.11.11:7890' in the PowerShell terminal not work, can you please add a proxy in config.json

j178 commented 1 year ago

chatgpt supports http_proxy and https_proxy out of the box.

In PowerShell, you should use $env:http_proxy='http://172.16.11.11:7890/' to set the environment variable.

baymax55 commented 1 year ago

chatgpt supports http_proxy and https_proxy out of the box.

In PowerShell, you should use $env:http_proxy='http://172.16.11.11:7890/' to set the environment variable.

still not wokring

image

but it works when use curl google.com -v in PowerShell

image

j178 commented 1 year ago

Thanks, I'll look into it.

j178 commented 1 year ago

Hi, I can't reproduce this on my Windows 11 machine. image

From previous example, chatgpt is indeed using the env var for proxy.

baymax55 commented 1 year ago

image

image

Hi, I can't reproduce this on my Windows 11 machine. image

From previous example, chatgpt is indeed using the env var for proxy.

j178 commented 1 year ago

From your screenshot, chatgpt picks up the correct env var with no problem.

I believe that your proxy may not be compatible with https proxy or it may not be properly configured to proxy api.openai.com. It might be a good idea to review the log of your proxy to investigate this issue.