app-builder icon indicating copy to clipboard operation
app-builder copied to clipboard

missing support of 'noproxy' directive from .npmrc

Open fgu-neo-soft opened this issue 4 years ago • 0 comments

In my project, we have a strict proxy configuration. app-builder (used via electron-builder) needs to download some elements to do its job, and for this it must use the proxy. At the end, to publish the build installer, we use a local server, that doesn't need the proxy. So it sounded natural to declare the publish server's URL in .npmrc/noproxy to bypass the proxy. This doesn't work, and we can see why in the following code : https://github.com/develar/app-builder/blob/c24d1b50fbd313650ccab2021945eb006a39f0ae/pkg/util/proxy.go#L38

The code reads the 'proxy' directive, but not the 'noproxy'...

Workaround : in the build scripts, I have separated the electron-builder call in two parts, such like :

  1. electron-builder -p never
  2. cross-env NO_PROXY=* electron-builder -p always -pd <release_dir>

The second line works because the special case NO_PROXY=* disable any proxy processing as seen here : https://github.com/develar/app-builder/blob/master/pkg/util/proxy.go#L17

fgu-neo-soft avatar Oct 22 '21 14:10 fgu-neo-soft