LJH LJH - 1 year ago 174
Node.js Question

Error with any Dropbox API calls (node.js) — "Error: getaddrinfo EAI_AGAIN api.dropboxapi.com:443"

I am attempting to set up Dropbox on my server side using Node.js. I have used the official documentation to write the very basic code to do this, with an access token generated from dropbox.com (just until I get this working). The code I used is shown below and is a variant on the code at http://dropbox.github.io/dropbox-sdk-js/index.html .

'use strict';
var express = require('express');
var router = express.Router();
var Dropbox = require('dropbox');
router.post('/testDropbox', function(req, res) {
console.log(req.body.dbxAccessToken);
var dbx = new Dropbox({ accessToken: req.body.dbxAccessToken});
console.log(dbx);
dbx.filesListFolder({ path: ''})
.then(function (response) {
console.log(response);
res.send(repsonse);
})
.catch(function (err) {
console.log(err);
res.send(err);
})
});


This caught error reads "Error: getaddrinfo EAI_AGAIN api.dropboxapi.com:443".

I am releatively new to Node.js so I hope it something simple I have missed perhaps in the set up.
Also, I am behind a proxy that uses NTLM and seeing an error with "443" in it does ring some alarm bells in my head.

LJH LJH
Answer Source

Your proxy may be blocking calls

If you can bypass the proxy, try this to see if the proxy is causing the issue. Unfortunately, many corporations don't allow one to bypass a proxy so you may need to speak to someone in charge of such things to try and help.

The workaround I use

I now use a WiFi dongle connected to an external router to bypass the proxy. My code, as shown in the question, works as expected and with no errors.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download