nativefier / nativefier

Make any web page a desktop application
MIT License
34.84k stars 2.19k forks source link

Build fails when behind proxy / VPN / China GFW #479

Open BirkhoffLee opened 6 years ago

BirkhoffLee commented 6 years ago

Description

I have absolutely no idea why is this happening. The only special thing to me is that I'm behind China's great firewall (GFW), but I don't think that can interfere local connections. Any thoughts?

birkhoff at Birkhoff-MBPR in ~
$ nativefier "https://www.bing.com"
Downloading tmp-16092-0-electron-v1.6.6-darwin-x64.zip
Error: connect ECONNREFUSED 127.0.0.1:443

{ Error: connect ECONNREFUSED 127.0.0.1:443
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 443 }
  packaging [========================================          ] 80%

Steps to reproduce issue

  1. Install nativefier
  2. Run nativefier "https://www.bing.com"

Details

<Error message / Stack trace here>
ronjouch commented 6 years ago

@BirkhoffLee eeeeeh I don't know. It would be great for nativefier to support spitting finer logging when an environment variable is set. Without that it's difficult to troubleshoot.

In your case, I don't understand who makes a request to localhost (127.0.0.1) on HTTPS (port 443), and why. Does your machine run some kind of proxy / antivirus / traffic sniffing&redirecting software?

qaid commented 6 years ago

I am able to reproduce this result, which occurs only when I am running my connection through a VPN. This is my terminal output when I try to create an Asana app:

nativefier https://app.asana.com/
Downloading tmp-4147-0-electron-v1.6.6-darwin-x64.zip
Error: connect ECONNREFUSED 127.0.0.1:443

{ Error: connect ECONNREFUSED 127.0.0.1:443
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 443 }
  packaging [========================================          ] 80%10:43 PM

The process just hangs there.

When I de-activate the VPN, I am able to complete the app creation without a problem.

ronjouch commented 6 years ago

Ha, thanks for the pointer, @qaid 👍👍👍! Not sure which part of Nativefier is confused by the VPN though oÔ, more digging from your side very welcome.

BirkhoffLee commented 6 years ago

Yes, my machine runs a proxy that bypasses the GFW. I turned it off and Nativefier still connects to 127.0.0.1:443. It's a SOCKS5 proxy that listens on 127.0.0.1:1080.

Sorry I didn't see @qaid's comment. I'll try to find out more information and possible reason and see what I can help here.

BirkhoffLee commented 6 years ago

So I figured out by resetting env variable ALL_PROXY. Nativefier won't connect to 127.0.0.1 anymore.

ronjouch commented 6 years ago

@BirkhoffLee thanks for the followup 👍.

So I figured out by resetting env variable ALL_PROXY

Just to clarify: you mean ALL_PROXY= nativefier ..., correct?

Nativefier won't connect to 127.0.0.1 anymore.

Awesome. Out of curiosity, any idea which part of our stack reacts to this variable?

@qaid does ALL_PROXY have an effect on your failure?

BirkhoffLee commented 6 years ago

@ronjouch Yes, I ran ALL_PROXY= nativefier .... I just tried it again and it doesn't work now. Here's a video: https://asciinema.org/a/XCTmfoItFn2cZVrRMuN50ry68.

I have confirmed that the system proxy is empty, no idea why.

ronjouch commented 6 years ago

Developers/passersby: consolidating Build fails at 61% during packaging here.

xiaoguli commented 5 years ago

$ nativefier "https://baidu.com" Downloading tmp-3890-0-electron-v3.0.3-darwin-x64.zip Error: connect ECONNREFUSED 127.0.0.1:443 { Error: connect ECONNREFUSED 127.0.0.1:443 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util.js:1014:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14) code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 443 } packaging [======================================== ] 79% @ronjouch @BirkhoffLee Same problem, unable to complete packaging. Any good ideas now?

imydou commented 4 years ago

export ELECTRON_GET_USE_PROXY=1 # 值为1或true export GLOBAL_AGENT_HTTP_PROXY=http://proxy.example.com:1080 export GLOBAL_AGENT_HTTPS_PROXY=https://proxy.example.com:1080