Server IP : 192.64.118.117 / Your IP : 3.145.158.137 Web Server : LiteSpeed System : Linux premium56.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64 User : thecgapy ( 1160) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/alt-nodejs20/root/lib/node_modules/npm/node_modules/node-gyp/lib/ |
Upload File : |
const fetch = require('make-fetch-happen') const { promises: fs } = require('graceful-fs') const log = require('./log') async function download (gyp, url) { log.http('GET', url) const requestOpts = { headers: { 'User-Agent': `node-gyp v${gyp.version} (node ${process.version})`, Connection: 'keep-alive' }, proxy: gyp.opts.proxy, noProxy: gyp.opts.noproxy } const cafile = gyp.opts.cafile if (cafile) { requestOpts.ca = await readCAFile(cafile) } const res = await fetch(url, requestOpts) log.http(res.status, res.url) return res } async function readCAFile (filename) { // The CA file can contain multiple certificates so split on certificate // boundaries. [\S\s]*? is used to match everything including newlines. const ca = await fs.readFile(filename, 'utf8') const re = /(-----BEGIN CERTIFICATE-----[\S\s]*?-----END CERTIFICATE-----)/g return ca.match(re) } module.exports = { download, readCAFile }