Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading jar over https protocol #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

muriloamendola
Copy link

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)

@jm974
Copy link

jm974 commented Jan 10, 2020

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) {

Copy link

@AaronRohrbacher AaronRohrbacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, please merge!

fs = require('fs'),
ProgressBar = require('progress'),
utils = require('./utils');

var download = function (downloadUrl, installPath, callback) {
console.log("Started downloading Dynamodb-local. Process may take few minutes.");
http.get(downloadUrl, function (response) {
https.get(downloadUrl, function (response) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muriloamendola

Please resolve this part of the conflict.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, master branch seems to have been modified in many other places besides this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears the original developer may not be active on this thread, I created a applied these same changes on the master branch and created a new PR: https://github.com/99x/dynamodb-localhost/pull/78

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parece que o desenvolvedor original pode não estar ativo neste tópico, criei e apliquei essas mesmas alterações no branch master e criei um novo PR: #78

Amigo como faço para atualizar no meu projeto e voltar a funcionar?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls we need this PR merged soon!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parece que o desenvolvedor original pode não estar ativo neste tópico, criei e apliquei essas mesmas alterações no branch master e criei um novo PR: #78

Amigo como faço para atualizar no meu projeto e voltar a funcionar?

To get his working we will need the PR merged and the subsequent package serverless-dynamodb-local updated to use the new version of this package. I assume the package will be incremented to 0.0.10 when it is merged.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants