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 node-fetch with electron-fetch #3108

Merged
merged 1 commit into from Sep 23, 2018

Conversation

mdogadailo
Copy link
Contributor

When a user startshyper, it sends the request to https://hyper-news.now.sh from notifications.js file. If the user is behind the proxy server, this request is going to fail, because in this case, we have to find

  • if the user using the proxy
  • the configuration of this proxy
  • and credentials

(another scenario from Linux auto update)

This pull request replace node-fetch with electron-fetch.

The electron-fetch repeats API from node-fetch (it was forked from last one), but it's using Electron net module, so hyper don't need to care about proxy configuration.
The net module provides

  • Automatic management of system proxy configuration, support of the wpad protocol and proxy pac configuration files.
  • Automatic tunneling of HTTPS requests.
  • Support for authenticating proxies using basic, digest, NTLM, Kerberos or negotiate authentication schemes.

Copy link
Contributor

@albinekb albinekb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@albinekb
Copy link
Contributor

Will this solve #1612 ?

@mdogadailo
Copy link
Contributor Author

@albinekb I'll try to reproduce #1612 next week if it solves that, I'll reply in #1612.

@albinekb albinekb requested a review from chabou July 2, 2018 12:07
@mdogadailo
Copy link
Contributor Author

Dear @albinekb I can't reproduce issue from #1612, looks like there are not a proxy issue.
I tried to replace response (it's possible that proxy server just replace content) from https://hyper-news.now.sh with 503 and 404.
I tried to made redirect. I tried to create 30 sec timeout on response. All good, just error to console.

2018-07-06_17-58-55

@jameschensmith
Copy link

What's the status of this PR? I'm behind a proxy, and would love for Hyper to be able to check for updates of my plugins, etc.

@chabou chabou merged commit 039b6fa into vercel:canary Sep 23, 2018
chabou pushed a commit that referenced this pull request Dec 15, 2018
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