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

allow truffle compile behind corporate proxy Issue 4016 #5847

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/compile-solidity/package.json
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
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";
joseluu marked this conversation as resolved.
Show resolved Hide resolved

var proxy = process.env.https_proxy || process.env.http_proxy;
joseluu marked this conversation as resolved.
Show resolved Hide resolved
var axios;
joseluu marked this conversation as resolved.
Show resolved Hide resolved
if (proxy) {
const HttpsProxyAgent = require("https-proxy-agent");
const agent = new HttpsProxyAgent(proxy);
axios = axios_plain.create({
httpsAgent: agent
});
} else {
axios = axios_plain;
}
joseluu marked this conversation as resolved.
Show resolved Hide resolved

import semver from "semver";

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
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