redhat-developer / redhat-developer/vscode-java
JDT.LS binary download does not honour VS Code http.proxy setting in corporate networks
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
Problem
On first install (or when the extension downloads a JDT.LS update), the download fails silently in corporate environments that require an authenticated HTTPS proxy. VS Code exposes the proxy via http.proxy and http.proxyAuthorization settings, and also via HTTPS_PROXY / HTTP_PROXY environment variables injected into the extension host. However, the extension's download logic (in src/extension.ts and the download utility) does not read these and passes no proxy configuration to its HTTP client.
Steps to Reproduce
- In a corporate environment, set:
"http.proxy": "http://proxy.corp.example.com:8080", "http.proxyStrictSSL": false - Install the extension on a machine that has no prior JDT.LS installation.
- Open a Java file. The status bar shows "Downloading Java support..." indefinitely.
- No error appears; the Output → Java channel shows a TCP timeout to
download.jboss.orgor the GitHub releases CDN.
Expected Behaviour
The extension should detect the proxy from vscode.workspace.getConfiguration('http').get('proxy') or process.env.HTTPS_PROXY and configure its HTTP download agent accordingly (e.g., via https-proxy-agent or equivalent).
Workaround (not acceptable)
Users currently have to pre-download JDT.LS manually, which is not discoverable and breaks on updates.
Proposed Fix
import HttpsProxyAgent from 'https-proxy-agent';
const proxyUrl = vscode.workspace.getConfiguration('http').get<string>('proxy')
?? process.env.HTTPS_PROXY ?? process.env.HTTP_PROXY;
const agent = proxyUrl ? new HttpsProxyAgent(proxyUrl) : undefined;
// Pass agent to node-fetch / got / axios download client
Environment
- OS: Windows 11 Enterprise 10.0.26200 (mandatory corporate proxy, no direct internet)
- VS Code: 1.89+
- Extension: redhat.java latest
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 src/extension.ts 和下载工具开始,然后确定哪个 HTTP 客户端负责处理 JDT.LS 下载,以及其 agent 配置是如何传递的。检查 issue 中描述的 VS Code http 设置以及 HTTPS_PROXY/HTTP_PROXY 输入。完成的标准是:下载(包括更新)能够通过经过身份验证的代理工作,且不会出现报告的静默超时。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript, vscode
- 领域
- devtools, networking
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100