Skip to content

Commit 7c25367

Browse files
committed
feat: move to @npmcli/agent
BREAKING CHANGE: this changes the underlying http agents to those provided by `@npmcli/agent`. Backwards compatibility should be fully implemented but due to the scope of this change it was made a breaking change out of an abundance of caution.
1 parent 5493550 commit 7c25367

File tree

6 files changed

+8
-921
lines changed

6 files changed

+8
-921
lines changed

lib/agent.js

-214
This file was deleted.

lib/dns.js

-49
This file was deleted.

lib/remote.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const promiseRetry = require('promise-retry')
44
const ssri = require('ssri')
55

66
const CachingMinipassPipeline = require('./pipeline.js')
7-
const getAgent = require('./agent.js')
7+
const { getAgent } = require('@npmcli/agent')
88
const pkg = require('../package.json')
99

1010
const USER_AGENT = `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})`
@@ -14,9 +14,15 @@ const RETRY_ERRORS = [
1414
'ECONNREFUSED', // remote host refused to open connection
1515
'EADDRINUSE', // failed to bind to a local port (proxy?)
1616
'ETIMEDOUT', // someone in the transaction is WAY TOO SLOW
17-
'ERR_SOCKET_TIMEOUT', // same as above, but this one comes from agentkeepalive
17+
// from @npmcli/agent
18+
'ECONNECTIONTIMEOUT',
19+
'EIDLETIMEOUT',
20+
'ERESPONSETIMEOUT',
21+
'ETRANSFERTIMEOUT',
1822
// Known codes we do NOT retry on:
1923
// ENOTFOUND (getaddrinfo failure. Either bad hostname, or offline)
24+
// EINVALIDPROXY // invalid protocol from @npmcli/agent
25+
// EINVALIDRESPONSE // invalid status code from @npmcli/agent
2026
]
2127

2228
const RETRY_TYPES = [

0 commit comments

Comments
 (0)