-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support authenticating proxies #1
Support authenticating proxies #1
Conversation
Requires providing user and password options.
cc @arantes555 we're using |
@CharlieHess Thanks for the PR ! Glad to see electron-fetch being used ;) I have no trouble with your PR, and spent a bit of time earlier today cleaning up and updating master so the tests pass. However, I wanted to write a few tests for your feature before merging it. I've started in the https://github.com/arantes555/electron-fetch/tree/proxy-auth-test branch, if you wanna take a look. I'll merge and publish a new version as soon as I got them running :) |
@arantes555 awesome, definitely admire the test coverage here. ✨ |
Codecov Report
@@ Coverage Diff @@
## master #1 +/- ##
==========================================
- Coverage 99.74% 98.76% -0.99%
==========================================
Files 6 6
Lines 399 405 +6
Branches 131 133 +2
==========================================
+ Hits 398 400 +2
- Misses 1 5 +4
Continue to review full report at Codecov.
|
Hey @CharlieHess I adjusted a few things and merged your PR in the test branch https://github.com/arantes555/electron-fetch/tree/proxy-auth-test @arantes555 created. It is now solved, and the tests pass. @arantes555 could you review my commits and publish if it's ok for you ? |
Did a tiny bit of cleanup and merged :) publication coming in a few minutes |
@CharlieHess v1.1.0 is published :) Thanks ! I'd love to hear more about how you're using it at Slack ;) |
@arantes555 thanks for the quick turnaround! Newer versions of Slack (from 3.0 on) will unload some "tabs" / teams based on usage. Those unloaded tabs will still make API calls to Slack from the Node.js process, so we can show notifications / badges. And all those API calls from the main process will use |
Electron's
net
module supports authenticating proxies out of the box, however, we need to listen to an additional event and invoke a callback, otherwise the proxied request becomes a black-holed request.This is pretty rudimentary but we'll just check the options passed to the request for
user
andpassword
fields. If those fields aren't provided we'll abort the request and bubble up an error.