Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
allow compilation behind corporate proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluu committed Jan 19, 2023
1 parent 4a4f889 commit fb301be
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/compile-solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"axios-retry": "^3.1.9",
"debug": "^4.3.1",
"fs-extra": "^9.1.0",
"https-proxy-agent": "^5.0.1",
"iter-tools": "^7.0.2",
"lodash": "^4.17.21",
"node-abort-controller": "^3.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ import originalRequire from "original-require";

// must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
import "../../polyfill";
import { default as axios, AxiosResponse } from "axios";
import { default as axios_plain, AxiosResponse } from "axios";

var proxy = process.env.https_proxy || process.env.http_proxy;
var axios;
if (proxy) {
const HttpsProxyAgent = require("https-proxy-agent");
const agent = new HttpsProxyAgent(proxy);
axios = axios_plain.create({
httpsAgent: agent
});
} else {
axios = axios_plain;
}

import semver from "semver";

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15498,7 +15498,7 @@ https-proxy-agent@^2.2.0:
agent-base "^4.3.0"
debug "^3.1.0"

https-proxy-agent@^5.0.0:
https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6"
integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==
Expand Down

0 comments on commit fb301be

Please sign in to comment.