cdk-ecr-deployment 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +26 -107
- package/.jsii.tabl.json +1 -1
- package/API.md +0 -59
- package/README.md +7 -17
- package/lib/index.d.ts +1 -29
- package/lib/index.js +8 -26
- package/package.json +1 -13
- package/build-lambda.sh +0 -12
- package/lambda-src/.dockerignore +0 -9
- package/lambda-src/Dockerfile +0 -26
- package/lambda-src/Makefile +0 -33
- package/lambda-src/go.mod +0 -136
- package/lambda-src/go.sum +0 -499
- package/lambda-src/internal/iolimits/iolimits.go +0 -68
- package/lambda-src/internal/iolimits/iolimits_test.go +0 -39
- package/lambda-src/internal/tarfile/reader.go +0 -179
- package/lambda-src/internal/tarfile/reader_test.go +0 -31
- package/lambda-src/internal/tarfile/s3file.go +0 -363
- package/lambda-src/internal/tarfile/s3file_test.go +0 -135
- package/lambda-src/internal/tarfile/src.go +0 -328
- package/lambda-src/internal/tarfile/types.go +0 -31
- package/lambda-src/main.go +0 -176
- package/lambda-src/main_test.go +0 -64
- package/lambda-src/s3/src.go +0 -40
- package/lambda-src/s3/transport.go +0 -149
- package/lambda-src/s3/transport_test.go +0 -96
- package/lambda-src/utils.go +0 -206
- package/lambda-src/utils_test.go +0 -63
- package/lib/config.d.ts +0 -1
- package/lib/config.js +0 -12
- package/node_modules/@sindresorhus/is/dist/index.d.ts +0 -232
- package/node_modules/@sindresorhus/is/dist/index.js +0 -434
- package/node_modules/@sindresorhus/is/dist/types.d.ts +0 -25
- package/node_modules/@sindresorhus/is/dist/types.js +0 -3
- package/node_modules/@sindresorhus/is/license +0 -9
- package/node_modules/@sindresorhus/is/package.json +0 -96
- package/node_modules/@sindresorhus/is/readme.md +0 -669
- package/node_modules/@szmarczak/http-timer/LICENSE +0 -21
- package/node_modules/@szmarczak/http-timer/README.md +0 -93
- package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +0 -32
- package/node_modules/@szmarczak/http-timer/dist/source/index.js +0 -126
- package/node_modules/@szmarczak/http-timer/package.json +0 -72
- package/node_modules/@types/cacheable-request/LICENSE +0 -21
- package/node_modules/@types/cacheable-request/README.md +0 -16
- package/node_modules/@types/cacheable-request/index.d.ts +0 -137
- package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +0 -1095
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.buffer.d.ts +0 -460
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +0 -1926
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +0 -1549
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +0 -579
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +0 -452
- package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +0 -4510
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +0 -599
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +0 -865
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +0 -124
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +0 -931
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +0 -1275
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +0 -4343
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +0 -511
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +0 -1959
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +0 -2558
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +0 -543
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +0 -92
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +0 -3966
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +0 -702
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +0 -1029
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +0 -495
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +0 -220
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +0 -200
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +0 -970
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +0 -2013
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +0 -153
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +0 -589
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/cacheable-request/node_modules/@types/node/sea.d.ts +0 -153
- package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +0 -439
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +0 -614
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +0 -1662
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +0 -2150
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +0 -1226
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +0 -197
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +0 -972
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +0 -2439
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +0 -808
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +0 -976
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +0 -181
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +0 -745
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +0 -539
- package/node_modules/@types/cacheable-request/node_modules/undici-types/LICENSE +0 -21
- package/node_modules/@types/cacheable-request/node_modules/undici-types/README.md +0 -6
- package/node_modules/@types/cacheable-request/node_modules/undici-types/agent.d.ts +0 -31
- package/node_modules/@types/cacheable-request/node_modules/undici-types/api.d.ts +0 -43
- package/node_modules/@types/cacheable-request/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/node_modules/@types/cacheable-request/node_modules/undici-types/cache.d.ts +0 -36
- package/node_modules/@types/cacheable-request/node_modules/undici-types/client.d.ts +0 -108
- package/node_modules/@types/cacheable-request/node_modules/undici-types/connector.d.ts +0 -34
- package/node_modules/@types/cacheable-request/node_modules/undici-types/content-type.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/undici-types/cookies.d.ts +0 -28
- package/node_modules/@types/cacheable-request/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/node_modules/@types/cacheable-request/node_modules/undici-types/dispatcher.d.ts +0 -255
- package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/node_modules/@types/cacheable-request/node_modules/undici-types/errors.d.ts +0 -149
- package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +0 -61
- package/node_modules/@types/cacheable-request/node_modules/undici-types/fetch.d.ts +0 -209
- package/node_modules/@types/cacheable-request/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/@types/cacheable-request/node_modules/undici-types/filereader.d.ts +0 -54
- package/node_modules/@types/cacheable-request/node_modules/undici-types/formdata.d.ts +0 -108
- package/node_modules/@types/cacheable-request/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/node_modules/@types/cacheable-request/node_modules/undici-types/global-origin.d.ts +0 -7
- package/node_modules/@types/cacheable-request/node_modules/undici-types/handlers.d.ts +0 -15
- package/node_modules/@types/cacheable-request/node_modules/undici-types/header.d.ts +0 -4
- package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +0 -71
- package/node_modules/@types/cacheable-request/node_modules/undici-types/interceptors.d.ts +0 -17
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-client.d.ts +0 -25
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +0 -55
- package/node_modules/@types/cacheable-request/node_modules/undici-types/patch.d.ts +0 -33
- package/node_modules/@types/cacheable-request/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/node_modules/@types/cacheable-request/node_modules/undici-types/pool.d.ts +0 -39
- package/node_modules/@types/cacheable-request/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/node_modules/@types/cacheable-request/node_modules/undici-types/readable.d.ts +0 -60
- package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/node_modules/@types/cacheable-request/node_modules/undici-types/util.d.ts +0 -18
- package/node_modules/@types/cacheable-request/node_modules/undici-types/webidl.d.ts +0 -222
- package/node_modules/@types/cacheable-request/node_modules/undici-types/websocket.d.ts +0 -150
- package/node_modules/@types/cacheable-request/package.json +0 -35
- package/node_modules/@types/http-cache-semantics/LICENSE +0 -21
- package/node_modules/@types/http-cache-semantics/README.md +0 -15
- package/node_modules/@types/http-cache-semantics/index.d.ts +0 -165
- package/node_modules/@types/http-cache-semantics/package.json +0 -25
- package/node_modules/@types/keyv/LICENSE +0 -21
- package/node_modules/@types/keyv/README.md +0 -16
- package/node_modules/@types/keyv/index.d.ts +0 -90
- package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +0 -1095
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.buffer.d.ts +0 -460
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +0 -1926
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +0 -1549
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +0 -579
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +0 -452
- package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +0 -4510
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +0 -599
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +0 -865
- package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +0 -124
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +0 -931
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +0 -1275
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +0 -4343
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +0 -511
- package/node_modules/@types/keyv/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +0 -1959
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +0 -2558
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +0 -543
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +0 -92
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +0 -3966
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +0 -702
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +0 -1029
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +0 -495
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +0 -220
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +0 -200
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +0 -970
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +0 -2013
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +0 -153
- package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +0 -589
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/keyv/node_modules/@types/node/sea.d.ts +0 -153
- package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +0 -439
- package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +0 -614
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +0 -1662
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +0 -2150
- package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +0 -1226
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +0 -197
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +0 -972
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +0 -2439
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +0 -808
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +0 -976
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +0 -181
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +0 -745
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +0 -539
- package/node_modules/@types/keyv/node_modules/undici-types/LICENSE +0 -21
- package/node_modules/@types/keyv/node_modules/undici-types/README.md +0 -6
- package/node_modules/@types/keyv/node_modules/undici-types/agent.d.ts +0 -31
- package/node_modules/@types/keyv/node_modules/undici-types/api.d.ts +0 -43
- package/node_modules/@types/keyv/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/node_modules/@types/keyv/node_modules/undici-types/cache.d.ts +0 -36
- package/node_modules/@types/keyv/node_modules/undici-types/client.d.ts +0 -108
- package/node_modules/@types/keyv/node_modules/undici-types/connector.d.ts +0 -34
- package/node_modules/@types/keyv/node_modules/undici-types/content-type.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/undici-types/cookies.d.ts +0 -28
- package/node_modules/@types/keyv/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/node_modules/@types/keyv/node_modules/undici-types/dispatcher.d.ts +0 -255
- package/node_modules/@types/keyv/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/node_modules/@types/keyv/node_modules/undici-types/errors.d.ts +0 -149
- package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +0 -61
- package/node_modules/@types/keyv/node_modules/undici-types/fetch.d.ts +0 -209
- package/node_modules/@types/keyv/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/@types/keyv/node_modules/undici-types/filereader.d.ts +0 -54
- package/node_modules/@types/keyv/node_modules/undici-types/formdata.d.ts +0 -108
- package/node_modules/@types/keyv/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/node_modules/@types/keyv/node_modules/undici-types/global-origin.d.ts +0 -7
- package/node_modules/@types/keyv/node_modules/undici-types/handlers.d.ts +0 -15
- package/node_modules/@types/keyv/node_modules/undici-types/header.d.ts +0 -4
- package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +0 -71
- package/node_modules/@types/keyv/node_modules/undici-types/interceptors.d.ts +0 -17
- package/node_modules/@types/keyv/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/node_modules/@types/keyv/node_modules/undici-types/mock-client.d.ts +0 -25
- package/node_modules/@types/keyv/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/node_modules/@types/keyv/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/node_modules/@types/keyv/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/node_modules/@types/keyv/node_modules/undici-types/package.json +0 -55
- package/node_modules/@types/keyv/node_modules/undici-types/patch.d.ts +0 -33
- package/node_modules/@types/keyv/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/node_modules/@types/keyv/node_modules/undici-types/pool.d.ts +0 -39
- package/node_modules/@types/keyv/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/node_modules/@types/keyv/node_modules/undici-types/readable.d.ts +0 -60
- package/node_modules/@types/keyv/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/node_modules/@types/keyv/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/node_modules/@types/keyv/node_modules/undici-types/util.d.ts +0 -18
- package/node_modules/@types/keyv/node_modules/undici-types/webidl.d.ts +0 -222
- package/node_modules/@types/keyv/node_modules/undici-types/websocket.d.ts +0 -150
- package/node_modules/@types/keyv/package.json +0 -32
- package/node_modules/@types/responselike/LICENSE +0 -21
- package/node_modules/@types/responselike/README.md +0 -48
- package/node_modules/@types/responselike/index.d.ts +0 -29
- package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +0 -1095
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.buffer.d.ts +0 -460
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +0 -1926
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +0 -1549
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +0 -579
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +0 -452
- package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +0 -4510
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +0 -599
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +0 -865
- package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +0 -124
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +0 -931
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +0 -1275
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +0 -4343
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +0 -511
- package/node_modules/@types/responselike/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +0 -1959
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +0 -2558
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +0 -543
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +0 -92
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +0 -3966
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +0 -702
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +0 -1029
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +0 -495
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +0 -220
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +0 -200
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +0 -970
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +0 -2013
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +0 -153
- package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +0 -589
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/responselike/node_modules/@types/node/sea.d.ts +0 -153
- package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +0 -439
- package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +0 -614
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +0 -1662
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +0 -2150
- package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +0 -1226
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +0 -197
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +0 -972
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +0 -2439
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +0 -808
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +0 -976
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +0 -181
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +0 -745
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +0 -539
- package/node_modules/@types/responselike/node_modules/undici-types/LICENSE +0 -21
- package/node_modules/@types/responselike/node_modules/undici-types/README.md +0 -6
- package/node_modules/@types/responselike/node_modules/undici-types/agent.d.ts +0 -31
- package/node_modules/@types/responselike/node_modules/undici-types/api.d.ts +0 -43
- package/node_modules/@types/responselike/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/node_modules/@types/responselike/node_modules/undici-types/cache.d.ts +0 -36
- package/node_modules/@types/responselike/node_modules/undici-types/client.d.ts +0 -108
- package/node_modules/@types/responselike/node_modules/undici-types/connector.d.ts +0 -34
- package/node_modules/@types/responselike/node_modules/undici-types/content-type.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/undici-types/cookies.d.ts +0 -28
- package/node_modules/@types/responselike/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/node_modules/@types/responselike/node_modules/undici-types/dispatcher.d.ts +0 -255
- package/node_modules/@types/responselike/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/node_modules/@types/responselike/node_modules/undici-types/errors.d.ts +0 -149
- package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +0 -61
- package/node_modules/@types/responselike/node_modules/undici-types/fetch.d.ts +0 -209
- package/node_modules/@types/responselike/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/@types/responselike/node_modules/undici-types/filereader.d.ts +0 -54
- package/node_modules/@types/responselike/node_modules/undici-types/formdata.d.ts +0 -108
- package/node_modules/@types/responselike/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/node_modules/@types/responselike/node_modules/undici-types/global-origin.d.ts +0 -7
- package/node_modules/@types/responselike/node_modules/undici-types/handlers.d.ts +0 -15
- package/node_modules/@types/responselike/node_modules/undici-types/header.d.ts +0 -4
- package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +0 -71
- package/node_modules/@types/responselike/node_modules/undici-types/interceptors.d.ts +0 -17
- package/node_modules/@types/responselike/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/node_modules/@types/responselike/node_modules/undici-types/mock-client.d.ts +0 -25
- package/node_modules/@types/responselike/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/node_modules/@types/responselike/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/node_modules/@types/responselike/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/node_modules/@types/responselike/node_modules/undici-types/package.json +0 -55
- package/node_modules/@types/responselike/node_modules/undici-types/patch.d.ts +0 -33
- package/node_modules/@types/responselike/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/node_modules/@types/responselike/node_modules/undici-types/pool.d.ts +0 -39
- package/node_modules/@types/responselike/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/node_modules/@types/responselike/node_modules/undici-types/readable.d.ts +0 -60
- package/node_modules/@types/responselike/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/node_modules/@types/responselike/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/node_modules/@types/responselike/node_modules/undici-types/util.d.ts +0 -18
- package/node_modules/@types/responselike/node_modules/undici-types/webidl.d.ts +0 -222
- package/node_modules/@types/responselike/node_modules/undici-types/websocket.d.ts +0 -150
- package/node_modules/@types/responselike/package.json +0 -27
- package/node_modules/cacheable-lookup/LICENSE +0 -21
- package/node_modules/cacheable-lookup/README.md +0 -240
- package/node_modules/cacheable-lookup/index.d.ts +0 -139
- package/node_modules/cacheable-lookup/package.json +0 -45
- package/node_modules/cacheable-lookup/source/index.js +0 -436
- package/node_modules/cacheable-request/LICENSE +0 -21
- package/node_modules/cacheable-request/README.md +0 -206
- package/node_modules/cacheable-request/package.json +0 -56
- package/node_modules/cacheable-request/src/index.js +0 -251
- package/node_modules/clone-response/LICENSE +0 -21
- package/node_modules/clone-response/README.md +0 -62
- package/node_modules/clone-response/node_modules/mimic-response/index.js +0 -32
- package/node_modules/clone-response/node_modules/mimic-response/license +0 -9
- package/node_modules/clone-response/node_modules/mimic-response/package.json +0 -37
- package/node_modules/clone-response/node_modules/mimic-response/readme.md +0 -54
- package/node_modules/clone-response/package.json +0 -41
- package/node_modules/clone-response/src/index.js +0 -17
- package/node_modules/decompress-response/index.d.ts +0 -22
- package/node_modules/decompress-response/index.js +0 -58
- package/node_modules/decompress-response/license +0 -9
- package/node_modules/decompress-response/package.json +0 -56
- package/node_modules/decompress-response/readme.md +0 -48
- package/node_modules/defer-to-connect/LICENSE +0 -21
- package/node_modules/defer-to-connect/README.md +0 -38
- package/node_modules/defer-to-connect/dist/source/index.d.ts +0 -10
- package/node_modules/defer-to-connect/dist/source/index.js +0 -47
- package/node_modules/defer-to-connect/package.json +0 -71
- package/node_modules/end-of-stream/LICENSE +0 -21
- package/node_modules/end-of-stream/README.md +0 -54
- package/node_modules/end-of-stream/index.js +0 -94
- package/node_modules/end-of-stream/package.json +0 -37
- package/node_modules/get-stream/buffer-stream.js +0 -52
- package/node_modules/get-stream/index.d.ts +0 -108
- package/node_modules/get-stream/index.js +0 -60
- package/node_modules/get-stream/license +0 -9
- package/node_modules/get-stream/package.json +0 -50
- package/node_modules/get-stream/readme.md +0 -124
- package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +0 -2
- package/node_modules/got/dist/source/as-promise/create-rejection.js +0 -30
- package/node_modules/got/dist/source/as-promise/index.d.ts +0 -3
- package/node_modules/got/dist/source/as-promise/index.js +0 -176
- package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +0 -3
- package/node_modules/got/dist/source/as-promise/normalize-arguments.js +0 -78
- package/node_modules/got/dist/source/as-promise/parse-body.d.ts +0 -3
- package/node_modules/got/dist/source/as-promise/parse-body.js +0 -25
- package/node_modules/got/dist/source/as-promise/types.d.ts +0 -256
- package/node_modules/got/dist/source/as-promise/types.js +0 -42
- package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +0 -5
- package/node_modules/got/dist/source/core/calculate-retry-delay.js +0 -29
- package/node_modules/got/dist/source/core/index.d.ts +0 -1124
- package/node_modules/got/dist/source/core/index.js +0 -1505
- package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +0 -5
- package/node_modules/got/dist/source/core/utils/dns-ip-version.js +0 -17
- package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +0 -3
- package/node_modules/got/dist/source/core/utils/get-body-size.js +0 -32
- package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +0 -4
- package/node_modules/got/dist/source/core/utils/get-buffer.js +0 -16
- package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +0 -8
- package/node_modules/got/dist/source/core/utils/is-form-data.js +0 -4
- package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +0 -2
- package/node_modules/got/dist/source/core/utils/is-response-ok.js +0 -8
- package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +0 -14
- package/node_modules/got/dist/source/core/utils/options-to-url.js +0 -53
- package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +0 -3
- package/node_modules/got/dist/source/core/utils/proxy-events.js +0 -17
- package/node_modules/got/dist/source/core/utils/timed-out.d.ts +0 -29
- package/node_modules/got/dist/source/core/utils/timed-out.js +0 -121
- package/node_modules/got/dist/source/core/utils/unhandle.d.ts +0 -11
- package/node_modules/got/dist/source/core/utils/unhandle.js +0 -22
- package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +0 -15
- package/node_modules/got/dist/source/core/utils/url-to-options.js +0 -24
- package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +0 -8
- package/node_modules/got/dist/source/core/utils/weakable-map.js +0 -29
- package/node_modules/got/dist/source/create.d.ts +0 -5
- package/node_modules/got/dist/source/create.js +0 -240
- package/node_modules/got/dist/source/index.d.ts +0 -4
- package/node_modules/got/dist/source/index.js +0 -132
- package/node_modules/got/dist/source/types.d.ts +0 -344
- package/node_modules/got/dist/source/types.js +0 -2
- package/node_modules/got/dist/source/utils/deep-freeze.d.ts +0 -1
- package/node_modules/got/dist/source/utils/deep-freeze.js +0 -12
- package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +0 -2
- package/node_modules/got/dist/source/utils/deprecation-warning.js +0 -13
- package/node_modules/got/license +0 -9
- package/node_modules/got/package.json +0 -131
- package/node_modules/got/readme.md +0 -2477
- package/node_modules/hpagent/.github/dependabot.yml +0 -8
- package/node_modules/hpagent/.github/workflows/build.yml +0 -29
- package/node_modules/hpagent/LICENSE +0 -21
- package/node_modules/hpagent/README.md +0 -138
- package/node_modules/hpagent/index.d.ts +0 -26
- package/node_modules/hpagent/index.js +0 -101
- package/node_modules/hpagent/index.mjs +0 -5
- package/node_modules/hpagent/package.json +0 -49
- package/node_modules/hpagent/test/got.test.js +0 -111
- package/node_modules/hpagent/test/http-http.test.js +0 -351
- package/node_modules/hpagent/test/http-https.test.js +0 -313
- package/node_modules/hpagent/test/https-http.test.js +0 -313
- package/node_modules/hpagent/test/https-https.test.js +0 -313
- package/node_modules/hpagent/test/index.test-d.ts +0 -45
- package/node_modules/hpagent/test/needle.test.js +0 -103
- package/node_modules/hpagent/test/node-fetch.test.js +0 -103
- package/node_modules/hpagent/test/simple-get.test.js +0 -139
- package/node_modules/hpagent/test/ssl.cert +0 -19
- package/node_modules/hpagent/test/ssl.key +0 -27
- package/node_modules/hpagent/test/utils.js +0 -59
- package/node_modules/http-cache-semantics/LICENSE +0 -9
- package/node_modules/http-cache-semantics/README.md +0 -203
- package/node_modules/http-cache-semantics/index.js +0 -674
- package/node_modules/http-cache-semantics/package.json +0 -18
- package/node_modules/http2-wrapper/LICENSE +0 -21
- package/node_modules/http2-wrapper/README.md +0 -470
- package/node_modules/http2-wrapper/package.json +0 -54
- package/node_modules/http2-wrapper/source/agent.js +0 -670
- package/node_modules/http2-wrapper/source/auto.js +0 -149
- package/node_modules/http2-wrapper/source/client-request.js +0 -445
- package/node_modules/http2-wrapper/source/incoming-message.js +0 -58
- package/node_modules/http2-wrapper/source/index.js +0 -28
- package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +0 -27
- package/node_modules/http2-wrapper/source/utils/errors.js +0 -45
- package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +0 -13
- package/node_modules/http2-wrapper/source/utils/proxy-events.js +0 -7
- package/node_modules/http2-wrapper/source/utils/url-to-options.js +0 -25
- package/node_modules/json-buffer/.travis.yml +0 -3
- package/node_modules/json-buffer/LICENSE +0 -22
- package/node_modules/json-buffer/README.md +0 -24
- package/node_modules/json-buffer/index.js +0 -58
- package/node_modules/json-buffer/package.json +0 -34
- package/node_modules/json-buffer/test/index.js +0 -63
- package/node_modules/keyv/README.md +0 -429
- package/node_modules/keyv/package.json +0 -57
- package/node_modules/keyv/src/index.d.ts +0 -112
- package/node_modules/keyv/src/index.js +0 -259
- package/node_modules/lowercase-keys/index.d.ts +0 -16
- package/node_modules/lowercase-keys/index.js +0 -10
- package/node_modules/lowercase-keys/license +0 -9
- package/node_modules/lowercase-keys/package.json +0 -38
- package/node_modules/lowercase-keys/readme.md +0 -32
- package/node_modules/mimic-response/index.d.ts +0 -17
- package/node_modules/mimic-response/index.js +0 -77
- package/node_modules/mimic-response/license +0 -9
- package/node_modules/mimic-response/package.json +0 -42
- package/node_modules/mimic-response/readme.md +0 -78
- package/node_modules/normalize-url/index.d.ts +0 -267
- package/node_modules/normalize-url/index.js +0 -216
- package/node_modules/normalize-url/license +0 -9
- package/node_modules/normalize-url/package.json +0 -50
- package/node_modules/normalize-url/readme.md +0 -286
- package/node_modules/once/LICENSE +0 -15
- package/node_modules/once/README.md +0 -79
- package/node_modules/once/once.js +0 -42
- package/node_modules/once/package.json +0 -33
- package/node_modules/p-cancelable/index.d.ts +0 -176
- package/node_modules/p-cancelable/index.js +0 -111
- package/node_modules/p-cancelable/license +0 -9
- package/node_modules/p-cancelable/package.json +0 -49
- package/node_modules/p-cancelable/readme.md +0 -153
- package/node_modules/pump/.github/FUNDING.yml +0 -2
- package/node_modules/pump/.travis.yml +0 -5
- package/node_modules/pump/LICENSE +0 -21
- package/node_modules/pump/README.md +0 -74
- package/node_modules/pump/SECURITY.md +0 -5
- package/node_modules/pump/index.js +0 -86
- package/node_modules/pump/package.json +0 -24
- package/node_modules/pump/test-browser.js +0 -66
- package/node_modules/pump/test-node.js +0 -53
- package/node_modules/quick-lru/index.d.ts +0 -97
- package/node_modules/quick-lru/index.js +0 -123
- package/node_modules/quick-lru/license +0 -9
- package/node_modules/quick-lru/package.json +0 -43
- package/node_modules/quick-lru/readme.md +0 -111
- package/node_modules/resolve-alpn/LICENSE +0 -22
- package/node_modules/resolve-alpn/README.md +0 -60
- package/node_modules/resolve-alpn/index.js +0 -43
- package/node_modules/resolve-alpn/package.json +0 -34
- package/node_modules/responselike/LICENSE +0 -19
- package/node_modules/responselike/README.md +0 -77
- package/node_modules/responselike/package.json +0 -39
- package/node_modules/responselike/src/index.js +0 -34
- package/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/wrappy/README.md +0 -36
- package/node_modules/wrappy/package.json +0 -29
- package/node_modules/wrappy/wrappy.js +0 -33
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const http = require('http')
|
|
4
|
-
const test = require('ava')
|
|
5
|
-
const { createServer, createProxy } = require('./utils')
|
|
6
|
-
const { HttpProxyAgent } = require('../')
|
|
7
|
-
|
|
8
|
-
function request (opts) {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
const req = http.request(opts, resolve)
|
|
11
|
-
req.on('error', reject)
|
|
12
|
-
req.end(opts.body)
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
test('Basic', async t => {
|
|
17
|
-
const server = await createServer()
|
|
18
|
-
const proxy = await createProxy()
|
|
19
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
20
|
-
|
|
21
|
-
const response = await request({
|
|
22
|
-
method: 'GET',
|
|
23
|
-
hostname: server.address().address,
|
|
24
|
-
port: server.address().port,
|
|
25
|
-
path: '/',
|
|
26
|
-
agent: new HttpProxyAgent({
|
|
27
|
-
keepAlive: true,
|
|
28
|
-
keepAliveMsecs: 1000,
|
|
29
|
-
maxSockets: 256,
|
|
30
|
-
maxFreeSockets: 256,
|
|
31
|
-
scheduling: 'lifo',
|
|
32
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
let body = ''
|
|
37
|
-
response.setEncoding('utf8')
|
|
38
|
-
for await (const chunk of response) {
|
|
39
|
-
body += chunk
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
t.is(body, 'ok')
|
|
43
|
-
t.is(response.statusCode, 200)
|
|
44
|
-
|
|
45
|
-
server.close()
|
|
46
|
-
proxy.close()
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
test('Connection header (keep-alive)', async t => {
|
|
50
|
-
const server = await createServer()
|
|
51
|
-
const proxy = await createProxy()
|
|
52
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
53
|
-
|
|
54
|
-
proxy.authenticate = function (req, fn) {
|
|
55
|
-
t.is(req.headers.connection, 'keep-alive')
|
|
56
|
-
fn(null, true)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const response = await request({
|
|
60
|
-
method: 'GET',
|
|
61
|
-
hostname: server.address().address,
|
|
62
|
-
port: server.address().port,
|
|
63
|
-
path: '/',
|
|
64
|
-
agent: new HttpProxyAgent({
|
|
65
|
-
keepAlive: true,
|
|
66
|
-
keepAliveMsecs: 1000,
|
|
67
|
-
maxSockets: 256,
|
|
68
|
-
maxFreeSockets: 256,
|
|
69
|
-
scheduling: 'lifo',
|
|
70
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
let body = ''
|
|
75
|
-
response.setEncoding('utf8')
|
|
76
|
-
for await (const chunk of response) {
|
|
77
|
-
body += chunk
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
t.is(body, 'ok')
|
|
81
|
-
t.is(response.statusCode, 200)
|
|
82
|
-
|
|
83
|
-
server.close()
|
|
84
|
-
proxy.close()
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
test('Connection header (close)', async t => {
|
|
88
|
-
const server = await createServer()
|
|
89
|
-
const proxy = await createProxy()
|
|
90
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
91
|
-
|
|
92
|
-
proxy.authenticate = function (req, fn) {
|
|
93
|
-
t.is(req.headers.connection, 'close')
|
|
94
|
-
fn(null, true)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const response = await request({
|
|
98
|
-
method: 'GET',
|
|
99
|
-
hostname: server.address().address,
|
|
100
|
-
port: server.address().port,
|
|
101
|
-
path: '/',
|
|
102
|
-
agent: new HttpProxyAgent({
|
|
103
|
-
keepAlive: false,
|
|
104
|
-
keepAliveMsecs: 1000,
|
|
105
|
-
maxSockets: Infinity,
|
|
106
|
-
maxFreeSockets: 256,
|
|
107
|
-
scheduling: 'lifo',
|
|
108
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
let body = ''
|
|
113
|
-
response.setEncoding('utf8')
|
|
114
|
-
for await (const chunk of response) {
|
|
115
|
-
body += chunk
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
t.is(body, 'ok')
|
|
119
|
-
t.is(response.statusCode, 200)
|
|
120
|
-
|
|
121
|
-
server.close()
|
|
122
|
-
proxy.close()
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
test('Proxy authentication (empty)', async t => {
|
|
126
|
-
const server = await createServer()
|
|
127
|
-
const proxy = await createProxy()
|
|
128
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
129
|
-
|
|
130
|
-
proxy.authenticate = function (req, fn) {
|
|
131
|
-
fn(null, req.headers['proxy-authorization'] === undefined)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const response = await request({
|
|
135
|
-
method: 'GET',
|
|
136
|
-
hostname: server.address().address,
|
|
137
|
-
port: server.address().port,
|
|
138
|
-
path: '/',
|
|
139
|
-
agent: new HttpProxyAgent({
|
|
140
|
-
keepAlive: true,
|
|
141
|
-
keepAliveMsecs: 1000,
|
|
142
|
-
maxSockets: 256,
|
|
143
|
-
maxFreeSockets: 256,
|
|
144
|
-
scheduling: 'lifo',
|
|
145
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
let body = ''
|
|
150
|
-
response.setEncoding('utf8')
|
|
151
|
-
for await (const chunk of response) {
|
|
152
|
-
body += chunk
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
t.is(body, 'ok')
|
|
156
|
-
t.is(response.statusCode, 200)
|
|
157
|
-
|
|
158
|
-
server.close()
|
|
159
|
-
proxy.close()
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
test('Proxy authentication', async t => {
|
|
163
|
-
const server = await createServer()
|
|
164
|
-
const proxy = await createProxy()
|
|
165
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
166
|
-
|
|
167
|
-
proxy.authenticate = function (req, fn) {
|
|
168
|
-
fn(null, req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}`)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const response = await request({
|
|
172
|
-
method: 'GET',
|
|
173
|
-
hostname: server.address().address,
|
|
174
|
-
port: server.address().port,
|
|
175
|
-
path: '/',
|
|
176
|
-
agent: new HttpProxyAgent({
|
|
177
|
-
keepAlive: true,
|
|
178
|
-
keepAliveMsecs: 1000,
|
|
179
|
-
maxSockets: 256,
|
|
180
|
-
maxFreeSockets: 256,
|
|
181
|
-
scheduling: 'lifo',
|
|
182
|
-
proxy: `http://hello:world@${proxy.address().address}:${proxy.address().port}`
|
|
183
|
-
})
|
|
184
|
-
})
|
|
185
|
-
|
|
186
|
-
let body = ''
|
|
187
|
-
response.setEncoding('utf8')
|
|
188
|
-
for await (const chunk of response) {
|
|
189
|
-
body += chunk
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
t.is(body, 'ok')
|
|
193
|
-
t.is(response.statusCode, 200)
|
|
194
|
-
|
|
195
|
-
server.close()
|
|
196
|
-
proxy.close()
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
test('Configure the agent to reuse sockets', async t => {
|
|
200
|
-
const server = await createServer()
|
|
201
|
-
const proxy = await createProxy()
|
|
202
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
203
|
-
|
|
204
|
-
let count = 0
|
|
205
|
-
proxy.on('connection', () => {
|
|
206
|
-
count += 1
|
|
207
|
-
t.is(count, 1)
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
const agent = new HttpProxyAgent({
|
|
211
|
-
keepAlive: true,
|
|
212
|
-
keepAliveMsecs: 1000,
|
|
213
|
-
maxSockets: 256,
|
|
214
|
-
maxFreeSockets: 256,
|
|
215
|
-
scheduling: 'lifo',
|
|
216
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
let response = await request({
|
|
220
|
-
method: 'GET',
|
|
221
|
-
hostname: server.address().address,
|
|
222
|
-
port: server.address().port,
|
|
223
|
-
path: '/',
|
|
224
|
-
agent
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
let body = ''
|
|
228
|
-
response.setEncoding('utf8')
|
|
229
|
-
for await (const chunk of response) {
|
|
230
|
-
body += chunk
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
t.is(body, 'ok')
|
|
234
|
-
t.is(response.statusCode, 200)
|
|
235
|
-
|
|
236
|
-
response = await request({
|
|
237
|
-
method: 'GET',
|
|
238
|
-
hostname: server.address().address,
|
|
239
|
-
port: server.address().port,
|
|
240
|
-
path: '/',
|
|
241
|
-
agent
|
|
242
|
-
})
|
|
243
|
-
|
|
244
|
-
body = ''
|
|
245
|
-
response.setEncoding('utf8')
|
|
246
|
-
for await (const chunk of response) {
|
|
247
|
-
body += chunk
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
t.is(body, 'ok')
|
|
251
|
-
t.is(response.statusCode, 200)
|
|
252
|
-
|
|
253
|
-
server.close()
|
|
254
|
-
proxy.close()
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
test('Configure the agent to NOT reuse sockets', async t => {
|
|
258
|
-
const server = await createServer()
|
|
259
|
-
const proxy = await createProxy()
|
|
260
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
261
|
-
|
|
262
|
-
const ports = []
|
|
263
|
-
proxy.on('connection', socket => {
|
|
264
|
-
t.false(ports.includes(socket.remotePort))
|
|
265
|
-
ports.push(socket.remotePort)
|
|
266
|
-
})
|
|
267
|
-
|
|
268
|
-
const agent = new HttpProxyAgent({
|
|
269
|
-
keepAlive: false,
|
|
270
|
-
keepAliveMsecs: 1000,
|
|
271
|
-
maxSockets: Infinity,
|
|
272
|
-
maxFreeSockets: 256,
|
|
273
|
-
scheduling: 'lifo',
|
|
274
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
275
|
-
})
|
|
276
|
-
|
|
277
|
-
let response = await request({
|
|
278
|
-
method: 'GET',
|
|
279
|
-
hostname: server.address().address,
|
|
280
|
-
port: server.address().port,
|
|
281
|
-
path: '/',
|
|
282
|
-
agent
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
let body = ''
|
|
286
|
-
response.setEncoding('utf8')
|
|
287
|
-
for await (const chunk of response) {
|
|
288
|
-
body += chunk
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
t.is(body, 'ok')
|
|
292
|
-
t.is(response.statusCode, 200)
|
|
293
|
-
|
|
294
|
-
response = await request({
|
|
295
|
-
method: 'GET',
|
|
296
|
-
hostname: server.address().address,
|
|
297
|
-
port: server.address().port,
|
|
298
|
-
path: '/',
|
|
299
|
-
agent
|
|
300
|
-
})
|
|
301
|
-
|
|
302
|
-
body = ''
|
|
303
|
-
response.setEncoding('utf8')
|
|
304
|
-
for await (const chunk of response) {
|
|
305
|
-
body += chunk
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
t.is(body, 'ok')
|
|
309
|
-
t.is(response.statusCode, 200)
|
|
310
|
-
|
|
311
|
-
server.close()
|
|
312
|
-
proxy.close()
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
test('Test Host Header', async t => {
|
|
316
|
-
const server = await createServer()
|
|
317
|
-
const proxy = await createProxy()
|
|
318
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
319
|
-
|
|
320
|
-
proxy.authenticate = function (req, fn) {
|
|
321
|
-
t.is(req.headers.host, `${server.address().address}:${server.address().port}`)
|
|
322
|
-
fn(null, true)
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
const response = await request({
|
|
326
|
-
method: 'GET',
|
|
327
|
-
hostname: server.address().address,
|
|
328
|
-
port: server.address().port,
|
|
329
|
-
path: '/',
|
|
330
|
-
agent: new HttpProxyAgent({
|
|
331
|
-
keepAlive: true,
|
|
332
|
-
keepAliveMsecs: 1000,
|
|
333
|
-
maxSockets: 256,
|
|
334
|
-
maxFreeSockets: 256,
|
|
335
|
-
scheduling: 'lifo',
|
|
336
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
337
|
-
})
|
|
338
|
-
})
|
|
339
|
-
|
|
340
|
-
let body = ''
|
|
341
|
-
response.setEncoding('utf8')
|
|
342
|
-
for await (const chunk of response) {
|
|
343
|
-
body += chunk
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
t.is(body, 'ok')
|
|
347
|
-
t.is(response.statusCode, 200)
|
|
348
|
-
|
|
349
|
-
server.close()
|
|
350
|
-
proxy.close()
|
|
351
|
-
})
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const https = require('https')
|
|
4
|
-
const test = require('ava')
|
|
5
|
-
const { createSecureServer, createProxy } = require('./utils')
|
|
6
|
-
const { HttpsProxyAgent } = require('../')
|
|
7
|
-
|
|
8
|
-
function request (opts) {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
const req = https.request(opts, resolve)
|
|
11
|
-
req.on('error', reject)
|
|
12
|
-
req.end(opts.body)
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
test('Basic', async t => {
|
|
17
|
-
const server = await createSecureServer()
|
|
18
|
-
const proxy = await createProxy()
|
|
19
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
20
|
-
|
|
21
|
-
const response = await request({
|
|
22
|
-
method: 'GET',
|
|
23
|
-
hostname: server.address().address,
|
|
24
|
-
port: server.address().port,
|
|
25
|
-
path: '/',
|
|
26
|
-
agent: new HttpsProxyAgent({
|
|
27
|
-
keepAlive: true,
|
|
28
|
-
keepAliveMsecs: 1000,
|
|
29
|
-
maxSockets: 256,
|
|
30
|
-
maxFreeSockets: 256,
|
|
31
|
-
scheduling: 'lifo',
|
|
32
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
let body = ''
|
|
37
|
-
response.setEncoding('utf8')
|
|
38
|
-
for await (const chunk of response) {
|
|
39
|
-
body += chunk
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
t.is(body, 'ok')
|
|
43
|
-
t.is(response.statusCode, 200)
|
|
44
|
-
|
|
45
|
-
server.close()
|
|
46
|
-
proxy.close()
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
test('Connection header (keep-alive)', async t => {
|
|
50
|
-
const server = await createSecureServer()
|
|
51
|
-
const proxy = await createProxy()
|
|
52
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
53
|
-
|
|
54
|
-
proxy.authenticate = function (req, fn) {
|
|
55
|
-
t.is(req.headers.connection, 'keep-alive')
|
|
56
|
-
fn(null, true)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const response = await request({
|
|
60
|
-
method: 'GET',
|
|
61
|
-
hostname: server.address().address,
|
|
62
|
-
port: server.address().port,
|
|
63
|
-
path: '/',
|
|
64
|
-
agent: new HttpsProxyAgent({
|
|
65
|
-
keepAlive: true,
|
|
66
|
-
keepAliveMsecs: 1000,
|
|
67
|
-
maxSockets: 256,
|
|
68
|
-
maxFreeSockets: 256,
|
|
69
|
-
scheduling: 'lifo',
|
|
70
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
let body = ''
|
|
75
|
-
response.setEncoding('utf8')
|
|
76
|
-
for await (const chunk of response) {
|
|
77
|
-
body += chunk
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
t.is(body, 'ok')
|
|
81
|
-
t.is(response.statusCode, 200)
|
|
82
|
-
|
|
83
|
-
server.close()
|
|
84
|
-
proxy.close()
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
test('Connection header (close)', async t => {
|
|
88
|
-
const server = await createSecureServer()
|
|
89
|
-
const proxy = await createProxy()
|
|
90
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
91
|
-
|
|
92
|
-
proxy.authenticate = function (req, fn) {
|
|
93
|
-
t.is(req.headers.connection, 'close')
|
|
94
|
-
fn(null, true)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const response = await request({
|
|
98
|
-
method: 'GET',
|
|
99
|
-
hostname: server.address().address,
|
|
100
|
-
port: server.address().port,
|
|
101
|
-
path: '/',
|
|
102
|
-
agent: new HttpsProxyAgent({
|
|
103
|
-
keepAlive: false,
|
|
104
|
-
keepAliveMsecs: 1000,
|
|
105
|
-
maxSockets: Infinity,
|
|
106
|
-
maxFreeSockets: 256,
|
|
107
|
-
scheduling: 'lifo',
|
|
108
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
let body = ''
|
|
113
|
-
response.setEncoding('utf8')
|
|
114
|
-
for await (const chunk of response) {
|
|
115
|
-
body += chunk
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
t.is(body, 'ok')
|
|
119
|
-
t.is(response.statusCode, 200)
|
|
120
|
-
|
|
121
|
-
server.close()
|
|
122
|
-
proxy.close()
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
test('Proxy authentication (empty)', async t => {
|
|
126
|
-
const server = await createSecureServer()
|
|
127
|
-
const proxy = await createProxy()
|
|
128
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
129
|
-
|
|
130
|
-
proxy.authenticate = function (req, fn) {
|
|
131
|
-
fn(null, req.headers['proxy-authorization'] === undefined)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const response = await request({
|
|
135
|
-
method: 'GET',
|
|
136
|
-
hostname: server.address().address,
|
|
137
|
-
port: server.address().port,
|
|
138
|
-
path: '/',
|
|
139
|
-
agent: new HttpsProxyAgent({
|
|
140
|
-
keepAlive: true,
|
|
141
|
-
keepAliveMsecs: 1000,
|
|
142
|
-
maxSockets: 256,
|
|
143
|
-
maxFreeSockets: 256,
|
|
144
|
-
scheduling: 'lifo',
|
|
145
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
let body = ''
|
|
150
|
-
response.setEncoding('utf8')
|
|
151
|
-
for await (const chunk of response) {
|
|
152
|
-
body += chunk
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
t.is(body, 'ok')
|
|
156
|
-
t.is(response.statusCode, 200)
|
|
157
|
-
|
|
158
|
-
server.close()
|
|
159
|
-
proxy.close()
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
test('Proxy authentication', async t => {
|
|
163
|
-
const server = await createSecureServer()
|
|
164
|
-
const proxy = await createProxy()
|
|
165
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
166
|
-
|
|
167
|
-
proxy.authenticate = function (req, fn) {
|
|
168
|
-
fn(null, req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}`)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const response = await request({
|
|
172
|
-
method: 'GET',
|
|
173
|
-
hostname: server.address().address,
|
|
174
|
-
port: server.address().port,
|
|
175
|
-
path: '/',
|
|
176
|
-
agent: new HttpsProxyAgent({
|
|
177
|
-
keepAlive: true,
|
|
178
|
-
keepAliveMsecs: 1000,
|
|
179
|
-
maxSockets: 256,
|
|
180
|
-
maxFreeSockets: 256,
|
|
181
|
-
scheduling: 'lifo',
|
|
182
|
-
proxy: `http://hello:world@${proxy.address().address}:${proxy.address().port}`
|
|
183
|
-
})
|
|
184
|
-
})
|
|
185
|
-
|
|
186
|
-
let body = ''
|
|
187
|
-
response.setEncoding('utf8')
|
|
188
|
-
for await (const chunk of response) {
|
|
189
|
-
body += chunk
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
t.is(body, 'ok')
|
|
193
|
-
t.is(response.statusCode, 200)
|
|
194
|
-
|
|
195
|
-
server.close()
|
|
196
|
-
proxy.close()
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
test('Configure the agent to reuse sockets', async t => {
|
|
200
|
-
const server = await createSecureServer()
|
|
201
|
-
const proxy = await createProxy()
|
|
202
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
203
|
-
|
|
204
|
-
let count = 0
|
|
205
|
-
proxy.on('connection', () => {
|
|
206
|
-
count += 1
|
|
207
|
-
t.is(count, 1)
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
const agent = new HttpsProxyAgent({
|
|
211
|
-
keepAlive: true,
|
|
212
|
-
keepAliveMsecs: 1000,
|
|
213
|
-
maxSockets: 256,
|
|
214
|
-
maxFreeSockets: 256,
|
|
215
|
-
scheduling: 'lifo',
|
|
216
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
let response = await request({
|
|
220
|
-
method: 'GET',
|
|
221
|
-
hostname: server.address().address,
|
|
222
|
-
port: server.address().port,
|
|
223
|
-
path: '/',
|
|
224
|
-
agent
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
let body = ''
|
|
228
|
-
response.setEncoding('utf8')
|
|
229
|
-
for await (const chunk of response) {
|
|
230
|
-
body += chunk
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
t.is(body, 'ok')
|
|
234
|
-
t.is(response.statusCode, 200)
|
|
235
|
-
|
|
236
|
-
response = await request({
|
|
237
|
-
method: 'GET',
|
|
238
|
-
hostname: server.address().address,
|
|
239
|
-
port: server.address().port,
|
|
240
|
-
path: '/',
|
|
241
|
-
agent
|
|
242
|
-
})
|
|
243
|
-
|
|
244
|
-
body = ''
|
|
245
|
-
response.setEncoding('utf8')
|
|
246
|
-
for await (const chunk of response) {
|
|
247
|
-
body += chunk
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
t.is(body, 'ok')
|
|
251
|
-
t.is(response.statusCode, 200)
|
|
252
|
-
|
|
253
|
-
server.close()
|
|
254
|
-
proxy.close()
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
test('Configure the agent to NOT reuse sockets', async t => {
|
|
258
|
-
const server = await createSecureServer()
|
|
259
|
-
const proxy = await createProxy()
|
|
260
|
-
server.on('request', (req, res) => res.end('ok'))
|
|
261
|
-
|
|
262
|
-
const ports = []
|
|
263
|
-
proxy.on('connection', socket => {
|
|
264
|
-
t.false(ports.includes(socket.remotePort))
|
|
265
|
-
ports.push(socket.remotePort)
|
|
266
|
-
})
|
|
267
|
-
|
|
268
|
-
const agent = new HttpsProxyAgent({
|
|
269
|
-
keepAlive: false,
|
|
270
|
-
keepAliveMsecs: 1000,
|
|
271
|
-
maxSockets: Infinity,
|
|
272
|
-
maxFreeSockets: 256,
|
|
273
|
-
scheduling: 'lifo',
|
|
274
|
-
proxy: `http://${proxy.address().address}:${proxy.address().port}`
|
|
275
|
-
})
|
|
276
|
-
|
|
277
|
-
let response = await request({
|
|
278
|
-
method: 'GET',
|
|
279
|
-
hostname: server.address().address,
|
|
280
|
-
port: server.address().port,
|
|
281
|
-
path: '/',
|
|
282
|
-
agent
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
let body = ''
|
|
286
|
-
response.setEncoding('utf8')
|
|
287
|
-
for await (const chunk of response) {
|
|
288
|
-
body += chunk
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
t.is(body, 'ok')
|
|
292
|
-
t.is(response.statusCode, 200)
|
|
293
|
-
|
|
294
|
-
response = await request({
|
|
295
|
-
method: 'GET',
|
|
296
|
-
hostname: server.address().address,
|
|
297
|
-
port: server.address().port,
|
|
298
|
-
path: '/',
|
|
299
|
-
agent
|
|
300
|
-
})
|
|
301
|
-
|
|
302
|
-
body = ''
|
|
303
|
-
response.setEncoding('utf8')
|
|
304
|
-
for await (const chunk of response) {
|
|
305
|
-
body += chunk
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
t.is(body, 'ok')
|
|
309
|
-
t.is(response.statusCode, 200)
|
|
310
|
-
|
|
311
|
-
server.close()
|
|
312
|
-
proxy.close()
|
|
313
|
-
})
|