auto-updater icon indicating copy to clipboard operation
auto-updater copied to clipboard

unsupported URL with port

Open cragia opened this issue 5 years ago • 1 comments

I have a private gitlab server that manages my git projects. We couldn't expose the server on the 443 port because it was already taken, so we exposed the service on a custom port. For this reason when I do:

var autoupdater = new AutoUpdater({
  pathToJson: '',
  autoupdate: false,
  checkgit: true,
  jsonhost: 'gitlab.serinf.it:555',
  contenthost: 'xxx.com',
  progressDebounce: 0,
  devmode: true
});

it fails, and gives me the error:

download.error Error: getaddrinfo ENOTFOUND gitlab.serinf.it:555
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26) {
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'gitlab.serinf.it:555'
}

but obviously if I remove the ':555' port from the url, the connection is refused by the server...

how should I proceed?

thank you!

cragia avatar Feb 28 '20 07:02 cragia

Sadly I didn't consider this when making this package, but you're welcome to add support for it!

You can make a manual check on the remoteDownloader function by adding a check, if : is present on opt.path, split it. Put the first item on opt.path, and the second item on opt.port.

Line: https://github.com/juampi92/auto-updater/blob/master/auto-updater.js#L402 Https documentation: https://nodejs.org/api/https.html#https_https_request_url_options_callback

:)

juampi92 avatar Mar 18 '20 10:03 juampi92