给 VS Code 显式指定代理
在 VS Code 里打开 settings.json,加入类似配置:
{
"http.proxy": "http://{IP}:{Port}",
"http.proxySupport": "override",
"http.proxyStrictSSL": true
}
{IP}为IP地址,本机代理用127.0.0.1即可。如果 Codex 扩展实际运行在 WSL 环境,且WSL的NetworkingMode是NAT,则IP为Windows 主机 IP(可用命令“cat /etc/resolv.conf | grep nameserver” 查看);
{Port}是网络代理的具体端口号。
关键是:
"http.proxySupport": "override"
这表示让 VS Code 尽量按你指定的代理走,而不是只依赖系统代理自动检测。