Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/core/src/shared/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import crossFetch from 'cross-fetch'
const { HttpsProxyAgent } = require('https-proxy-agent')

const request = {
Copy link
Contributor Author

@Will-ShaoHua Will-ShaoHua Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suspecting proxy is not applied to the language server download path

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
Expand All @@ -23,7 +24,17 @@ const request = {
params?: RequestParamsArg,
wrappedFetch = crossFetch
): FetchRequest {
return new FetchRequest(url, { ...params, method }, wrappedFetch)
const proxy = process.env.HTTPS_PROXY || process.env.HTTP_PROXY
const updateParams: any = { ...params }
if (proxy) {
const proxyAgent = new HttpsProxyAgent(proxy)
updateParams.agent = proxyAgent
updateParams.headers = {
...(params?.headers || {}), // ???? do we need this?
}
}

return new FetchRequest(url, { ...updateParams, method }, wrappedFetch)
},
}
export default request
Expand Down
Loading