Skip to content

Commit

Permalink
introduce optional HTTPS_PROXY environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Feb 8, 2021
1 parent 9c0eb89 commit 84592a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
Project versioning adheres to [Semantic Versioning](http://semver.org/).
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).

## [7.6.12](https://github.com/locize/locize-cli/compare/v7.6.11...v7.6.12) - 2021-02-08

- introduce optional HTTPS_PROXY environment variable


## [7.6.11](https://github.com/locize/locize-cli/compare/v7.6.10...v7.6.11) - 2021-02-08

- --get-path param for sync command
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"flat": "5.0.2",
"fluent_conv": "3.1.0",
"gettext-converter": "1.0.6",
"https-proxy-agent": "5.0.0",
"ini": "2.0.0",
"js-yaml": "4.0.0",
"laravelphp": "2.0.3",
Expand Down
4 changes: 4 additions & 0 deletions request.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const package = require('./package.json');
const fetch = require('node-fetch');
const HttpsProxyAgent = require('https-proxy-agent');
const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY || process.env.https_proxy || process.env.HTTPS_PROXY;

module.exports = (url, options, callback) => {
if (httpProxy) options.agent = new HttpsProxyAgent(httpProxy);

options.headers = options.headers || {};
options.headers['User-Agent'] = `${package.name}/v${package.version} (node/${process.version}; ${process.platform} ${process.arch})`;
options.headers['X-User-Agent'] = options.headers['User-Agent'];
Expand Down

0 comments on commit 84592a2

Please sign in to comment.