Registry Mirror
Skip to content
This repository was archived by the owner on Apr 30, 2019. It is now read-only.
This repository was archived by the owner on Apr 30, 2019. It is now read-only.

TSD behind corporate proxy #71

Closed
Closed

Description

@jtburke

I'm trying to use tsd behind a corporate proxy. Using windows and the github "git bash" client.

$ tsd query jquery -a install

>> tsd 0.5.6 (beta)

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: connect ETIMEDOUT
    at errnoException (net.js:904:11)
    at Object.afterConnect [as oncomplete] (net.js:895:19)

It would be nice to be able to use tsd : )

Activity

  1. Bartvds commented on Feb 26, 2014

    @Bartvds
    Collaborator

    Thanks for reporting this.

    I'm not 100% sure why this happens but I'd like to make it work.

    Do you have some info on this proxy you are using? What type is it? And do you have to configure like your browser or other tools for it? (I've been lucky and only ever used fully transparent proxies).

  2. jtburke commented on Feb 26, 2014

    @jtburke
    Author

    After a little reading it appears to be a "Regular/Caching Proxy" because as an end user we configure the browers/tools to point at: http://proxy.company.com:8080. That being said I'm not all that well versed in proxy things; however, I could ask some of the engineers about it if you have some specific questions in mind.

  3. Bartvds commented on Feb 26, 2014

    @Bartvds
    Collaborator

    Google & Stackoverflow suggest this is a recurring problem in node apps, with a know solution:

    Could you do a quick test to verify this is your issue?

    I pushed a bare-bones test script to a branch: https://github.com/DefinitelyTyped/tsd/tree/dev/proxytest (link fixed :)

    If you grab those 2 files, cd into the directory and get the 2 dependencies (request & commander):

    npm install 
    

    Then run the script to do some https requests to gihub api:

    node ./test
    

    These should fail with the error from your report.

    Then directly specify the proxy and test again:

    node ./test -p <url-of-your-proxy>
    

    That should work as it will set request's proxy: https://github.com/DefinitelyTyped/tsd/blob/dev/proxytest/test.js#L59

    Then try to use the proxy from environment variable: it uses the same convention as npm, bower etc, so you might already have these set:

    node ./test -e
    

    The environment variables: https://github.com/DefinitelyTyped/tsd/blob/dev/proxytest/test.js#L22-L25

    If this works out I'll put the environment variable suport in tsd, and also create a global config file (like npm has a .npmrc) for convenience.

  4. jtburke commented on Feb 27, 2014

    @jtburke
    Author
    $ node ./test
    dont use proxy
    
    testing: https://raw.github.com/borisyankov/DefinitelyTyped/master/package.json
    
    events.js:72
            throw er; // Unhandled 'error' event
                  ^
    Error: connect ETIMEDOUT
        at errnoException (net.js:904:11)
        at Object.afterConnect [as oncomplete] (net.js:895:19)
    johnterrance.burke@WA12-D17577 /c/github/tsd (dev/proxytest)
    
    $ node ./test -p http://proxy.company.co.uk:8080
    using proxy: http://proxy.company.co.uk:8080
    
    testing: https://raw.github.com/borisyankov/DefinitelyTyped/master/package.json
    got a response
    status 200
    
    testing: https://github.com/_gh/api/rate_limit
    got a response
    status 200
    
    done!
    
    $ node ./test -e
    
    no proxy in process.env !
    
    testing: https://raw.github.com/borisyankov/DefinitelyTyped/master/package.json
    
    events.js:72
            throw er; // Unhandled 'error' event
                  ^
    Error: connect ETIMEDOUT
        at errnoException (net.js:904:11)
        at Object.afterConnect [as oncomplete] (net.js:895:19)
    

    $ export HTTP_PROXY=http://proxy.company.co.uk:8080

    $ node ./test -e
    using proxy from env: http://proxy.company.co.uk:8080
    
    testing: https://raw.github.com/borisyankov/DefinitelyTyped/master/package.json
    got a response
    status 200
    
    testing: https://github.com/_gh/api/rate_limit
    got a response
    status 200
    
    done!
    

    Hope this helps : )

  5. Bartvds commented on Feb 27, 2014

    @Bartvds
    Collaborator

    Thanks a lot, this really helps!

    The result is what I hoped for: I'll apply this and add global config file (like .tsdrc) so you only have to set it once.

    This will be part of next npm release: I'll probably push a preview tag to github a little sooner (days) so we can verify it is really solved.

  6. jtburke commented on Feb 27, 2014

    @jtburke
    Author

    Top work, thank you very much. I'll help verify/test it with the preview.

  7. michelsalib commented on Mar 7, 2014

    @michelsalib

    👍 I am waiting for a .tsdrc config file too. Is it normal that my HTTP_PROXY env variable is not taken into account in this case?

  8. Bartvds commented on Mar 7, 2014

    @Bartvds
    Collaborator

    Sorry for the wait! My Open Source time was claimed by another project's emergency last week (I collab also on DefinitelyTyped and had to re-rig the PR test script).

    But this is still top of my list, especially now there are two users waiting.

    @michelsalib The env fields are a convention but it is not an automatic thing: implementers need to do stuff to make it work: we use request.js which has support for proxies so it is a matter of reading the env field (or config file) and passing the value through (we checked that in the test above).

  9. Bartvds commented on Mar 8, 2014

    @Bartvds
    Collaborator

    I just pushed a preview tag with support for proxies to github: https://github.com/DefinitelyTyped/tsd/releases/tag/0.5.6-proxy

    It has the environment vars support as well as a global .tsdrc file.

    Let me know it these works for your setup.

  10. michelsalib commented on Mar 10, 2014

    @michelsalib

    I just tested it with HTTP_PROXY and it works like a charm. Thanks @Bartvds :)

  11. michelsalib commented on Mar 10, 2014

    @michelsalib

    Also works fine with grunt-tsd :D

  12. Bartvds commented on Mar 10, 2014

    @Bartvds
    Collaborator

    @michelsalib Cool, thanks for reporting back! This will be part of the next npm update then.

  13. jtburke commented on Mar 11, 2014

    @jtburke
    Author

    I just tested with the .tsdrc, works a treat. Thank you very much @Bartvds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions