Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace https with request to allow for proxy configuration #166

Conversation

chewiebug
Copy link

I would like to use "gulp --verify" behind a proxy server. The current implementation does not seem to be able to support a proxy configuration.

Solution: Replace "https" by "request" in get-blacklist.js to allow for proxy configuration.

@chewiebug
Copy link
Author

Test failure on travis-ci was due to a timeout executing "gulp --verify". I assume, that it has nothing to do with the changes in my pull request, since it didn't fail on appveyor nor in any other nodejs versions.

Would you still like me to improve something?

@phated
Copy link
Member

phated commented Aug 13, 2018

We're not changing to request, sorry. It's a massive dependency that has vulnerabilities all the time. If you'd like to manually add proxy support in a new PR, we'll review.

@phated phated closed this Aug 13, 2018
@chewiebug
Copy link
Author

chewiebug commented Aug 15, 2018 via email

@yocontra
Copy link
Member

@chewiebug Could easily implement this behavior https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables using https://github.com/TooTallNate/node-proxy-agent (http_proxy, https_proxy, and no_proxy env vars - dont think we need to fuss with the other ones)

@yocontra
Copy link
Member

It looks like they broke that out as well - https://www.npmjs.com/package/tunnel-agent

@yocontra
Copy link
Member

Just curious - why don't you configure your proxy across your whole OS?

@chewiebug
Copy link
Author

chewiebug commented Aug 15, 2018 via email

@phated
Copy link
Member

phated commented Aug 15, 2018

I'd prefer tunnel-agent over node-proxy-agent (which adds a bunch of deps). I also think we should use add configuration options to the .gulp.js config files instead of using environment variables. Maybe @sttk can jump in and help out (guidance or implementation)?

@chewiebug
Copy link
Author

chewiebug commented Aug 16, 2018 via email

@phated
Copy link
Member

phated commented Aug 17, 2018

@chewiebug proxy-agent pulls together a ton of different modules but we're just using it for https - so you'd want to look at the https://github.com/TooTallNate/node-https-proxy-agent subdependency.

@chewiebug
Copy link
Author

chewiebug commented Aug 20, 2018 via email

@chewiebug
Copy link
Author

chewiebug commented Aug 20, 2018 via email

@sttk
Copy link
Contributor

sttk commented Aug 21, 2018

@chewiebug I think proxy configuration should be added not to cli option but .gulp.js config file as @phated saying.

To pass configurations specified in .gulp.js file into getBlacklist function, you should append cfg (or necessary properties in cfg) at this line to arguments of getBlacklist here.

@chewiebug
Copy link
Author

chewiebug commented Aug 21, 2018 via email

@sttk
Copy link
Contributor

sttk commented Aug 22, 2018

@chewiebug Since cli-flags.js merges configurations in .gulp.js to cli options, adding to cli-flags.js is needed only when you make new configuration available via both .gulp.js and cli option. But for only .gulp.js, it's not needed.

@chewiebug
Copy link
Author

chewiebug commented Aug 23, 2018 via email

@chewiebug
Copy link
Author

I have pushed a branch using https-proxy-agent supporting .gulp.* for configuration of the proxy: master...chewiebug:feature/add-proxy-support-for-verify

I see one big catch: https-proxy-agent:2.2.1 requires node >= 4. So this won't run on node 0.10 / 0.12 (a lot of unittests fail).

I see the following options to address this:

  1. use https-proxy-agent:1.0.0; this is the last version to support node < 4
  2. look for a different package, which supports node 0.10 / 0.12 in its latest version (hints appreciated)
  3. copy tunnel-agent into gulp-cli's code base and try to make it run (not sure, if I'd succeed)
  4. drop support of node < 4 for gulp-cli

What do you think? Do you see other options, that would be a better fit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants