I have the impression that the SSL/TLS negotiation does not succeed because "got" forces the use of a too old version which is not compatible with my local proxy.
Also I don't encounter the problem when I use my own implementation of the Downloader interface, with axios instead of "got" :
import {Downloader} from "@electron/get/dist/esm/Downloader";
import * as fs from 'fs';
import axios, {AxiosRequestConfig, AxiosResponse} from "axios";
import * as Stream from "stream";
export class CustomDownloader implements Downloader<AxiosRequestConfig> {
async download(url: string, path: string, options: AxiosRequestConfig = {}): Promise<void> {
const writer = fs.createWriteStream(path)
const response: AxiosResponse<Stream> = await axios.get(
url, {
...options,
responseType: 'stream'
}
)
response.data.pipe(writer)
return new Promise((resolve, reject) => {
writer.on('finish', resolve)
writer.on('error', reject)
})
}
}
import {download} from "@electron/get";
import {CustomDownloader} from "./custom-downloader";
const version = "24.0.0";
(async () => {
const zipFilePath = await download(
version,
{
downloader: new CustomDownloader(), // this script fails if this line is removed
}
);
console.debug(zipFilePath)
console.log("OK")
})()
My implementation of the Downloader interface is more basic than the current implementation that uses "got", it doesn't allow customization with the progress bar (is that really useful?), but I still suggest add it and allow to choose it (for example with the environment variable ELECTRON_GET_USE_AXIOS=true), or simply replace the current implementation.
Hi, I use winfoom (https://github.com/ecovaci/winfoom) as a local proxy to connect my apps to our corporate proxy and I encounter the following error:
I have these environment variables: ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTP_PROXY=http://127.0.0.1:3128 http_proxy=http://127.0.0.1:3128 https_proxy=http://127.0.0.1:3128
I have the impression that the SSL/TLS negotiation does not succeed because "got" forces the use of a too old version which is not compatible with my local proxy. Also I don't encounter the problem when I use my own implementation of the Downloader interface, with axios instead of "got" :
My implementation of the Downloader interface is more basic than the current implementation that uses "got", it doesn't allow customization with the progress bar (is that really useful?), but I still suggest add it and allow to choose it (for example with the environment variable ELECTRON_GET_USE_AXIOS=true), or simply replace the current implementation.