Giter VIP home page Giter VIP logo

Comments (6)

mwbrooks avatar mwbrooks commented on June 5, 2024

Hi @tessem

I never accounted for users behind a proxy.

From your error message, it looks as though the api object was never created. Would you mind inspecting the error object and let me know what it says:

var client = require('phonegap-build-api');

client.auth({ username: 'zelda', password: 'tr1f0rce' }, function(e, api) {
    console.log(e);  // output the error object
});

Does your proxy require authentication as well?

from node-phonegap-build-api.

tessem avatar tessem commented on June 5, 2024

I have to admit I am fresh with Node.js so the proxy issue was more of a guess than expert knowledge. I do not have to authenticate with the proxy, only proxy host and port. The error shows as follows:

C:\nodejs>node.exe

var client = require('phonegap-build-api');
undefined

undefined

client.auth({ username: '[email protected]', password: 'PxxxWxxx' }, function(e, api) {
... console.log(e); // output the error object
... });
undefined
{ [Error: connect ETIMEDOUT] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect' }

Hope this helpes. Thanks for your time.

from node-phonegap-build-api.

mwbrooks avatar mwbrooks commented on June 5, 2024

Thanks for the info! I think you're right, the connection is timing out because it can't access the proxy.

Tomorrow I'll test the library on Windows (I never have) and add a patch to enable proxy configuration. I'll update this ticket once it's ready.

from node-phonegap-build-api.

mwbrooks avatar mwbrooks commented on June 5, 2024

Hi @tessem,

I've added support for a proxy server and managed to test it against a local copy of Charles Proxy. The client.auth(...) function now accepts options.proxy as the proxy server address.

Can you please update the NPM package to the latest version 0.3.2 and try a sample such as this:

// authenticate against phonegap build
client.auth({ username: '[email protected]', password: 'xxx', proxy: 'http://myproxy.com:8181' }, function(e, api) {

    // get your user account information
    api.get('/me', function(e, data) {
        console.log('error:', e);
        console.log('data:', data);
    });

});

from node-phonegap-build-api.

tessem avatar tessem commented on June 5, 2024

Tested successfully.
Thanks for your time !

from node-phonegap-build-api.

mwbrooks avatar mwbrooks commented on June 5, 2024

Perfect!

from node-phonegap-build-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.