Skip to content

Commit

Permalink
feat: add proxy support
Browse files Browse the repository at this point in the history
enabled proxy support for fetch by using proxy-agent.
  • Loading branch information
arika0093 committed Sep 4, 2023
1 parent 5cca7ad commit 15e93de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"dependencies": {
"bin-links": "^4.0.1",
"node-fetch": "^3.2.10",
"proxy-agent": "^6.3.1",
"tar": "6.1.15"
},
"release": {
Expand Down
3 changes: 2 additions & 1 deletion scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import binLinks from "bin-links";
import { createHash } from "crypto";
import fs from "fs";
import fetch from "node-fetch";
import { ProxyAgent } from "proxy-agent";
import path from "path";
import tar from "tar";
import zlib from "zlib";
Expand Down Expand Up @@ -71,7 +72,7 @@ const fetchAndParseCheckSumFile = async (packageJson) => {

// Fetch the checksum file
console.info("Downloading", checksumFileUrl);
const response = await fetch(checksumFileUrl);
const response = await fetch(checksumFileUrl, {agent: new ProxyAgent()});
if (response.ok) {
const checkSumContent = await response.text();
const lines = checkSumContent.split("\n");
Expand Down

0 comments on commit 15e93de

Please sign in to comment.