dynamodb-localhost icon indicating copy to clipboard operation
dynamodb-localhost copied to clipboard

Downloading jar over https protocol

Open muriloamendola opened this issue 6 years ago • 2 comments

This change was made to avoid the error when install process is executed:

Error: Error getting DynamoDb local latest tar.gz location: 301 at ClientRequest. (.../node_modules/serverless-dynamodb-local/node_modules/dynamodb-localhost/dynamodb/installer.js:14:26) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23) at Socket.socketOnData (_http_client.js:440:20) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:607:20) Error: Protocol "https:" not supported. Expected "http:" at new ClientRequest (_http_client.js:131:11) at request (http.js:38:10) at Object.get (http.js:42:13) at ClientRequest. (.../node_modules/serverless-dynamodb-local/node_modules/dynamodb-localhost/dynamodb/installer.js:16:18) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23) at Socket.socketOnData (_http_client.js:440:20) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:607:20)

muriloamendola avatar Mar 11 '19 14:03 muriloamendola

for request behind a proxy, update with the following:

http.get({
        host: PROXY_HOST,
        port: PROXY_PORT,
        headers:    {
            'Proxy-Authorization':  'Basic ' + new Buffer(PROXY_USER + ':' + PROXY_PASSWORD).toString('base64')
        },
        path: downloadUrl
    }, function (response) {

jm974 avatar Jan 10 '20 12:01 jm974

FYI: This package (dynamodb-localhost) doesn't appear to be maintained, with no new releases to NPM in over 4 years.

Solution: You can use aws-dynamodb-local, a maintained fork, instead. (Disclaimer: I am a contributor to this fork). It is a drop-in replacement for this package, and is updated to fix this bug. If you're using serverless-dynamodb-local, you can also replace that with it's equivalent serverless-dynamodb.

Migrating takes about 2 minutes, with a full guide in the README. Of course, it's all still open-source and MIT licensed. Ownership of this new package sits with a registered charity, that is committed to maintaining the package into the future and is open to contributions from the community.

domdomegg avatar Jul 04 '23 00:07 domdomegg