GithubHelp home page GithubHelp logo

Comments (15)

jimamster avatar jimamster commented on July 19, 2024

A little more info. I am running needle on:
mac osx 10.9.5

from needle.

tomas avatar tomas commented on July 19, 2024

Good point. I'll take a look and let you know what I find.

from needle.

jimamster avatar jimamster commented on July 19, 2024

Thanks.

from needle.

tomas avatar tomas commented on July 19, 2024

Fixed on 1e18950. Should be up on npm soon!

from needle.

jimamster avatar jimamster commented on July 19, 2024

That's great. Let me know when it reaches npm. Thanks.

Sent from my iPhone

On Dec 18, 2014, at 10:03 AM, TomΓ‘s Pollak [email protected] wrote:

Fixed on 1e18950. Should be up on npm soon!

β€”
Reply to this email directly or view it on GitHub.

from needle.

zetlen avatar zetlen commented on July 19, 2024

Hey, I can't wait to switch away from mikeal/request for a lightweight SDK, but this has to get released first. +1!

from needle.

tomas avatar tomas commented on July 19, 2024

This is already up! Sorry for not letting you know on time.

from needle.

zetlen avatar zetlen commented on July 19, 2024

Thanks for letting me know, but I'm still having some trouble! I'm able to tunnel requests through an HTTPS proxy successfully in Windows (with Fiddler), but not on OSX (with Charles). I have exported the root certificate, all other HTTPS requests work, and I can use Charles successfully with the mikeal/request module. But I switched away from mikeal/request because it's so heavy, and I really want to keep using your light, fluffy module. I need to be able to monitor requests in OSX! Do you have access to an OSX machine? Can you reproduce my problem? Thanks buddy.

from needle.

tomas avatar tomas commented on July 19, 2024

I do have access to an OSX machine. How can I reproduce the problem?

from needle.

zetlen avatar zetlen commented on July 19, 2024

Thanks for waiting. I created a quick Google Apps Script for demonstration purposes, because I needed something that delivered innocuous JSON from HTTPS. Here is your repro:

  1. Run Charles.app on OSX. Make sure that SSL is configured for all hosts, and that the certificates are configured correctly.

  2. Put the following code in a file called repro.js.

    var needle = require('needle');
    
    needle.post('https://script.google.com/macros/s/AKfycbypnnX10X3ER4eMNOYUmKGF7noa5HMk0irFhKs0Ig7mpMnnG_OA/exec', {
      year: process.argv[process.argv.length-1]
    }, {
      proxy: 'http://127.0.0.1:8888',
      rejectUnauthorized: false,
      follow_max: 5,
      json: true
    }, function(err, res) {
      if (err) throw err;
      console.log(('got post response', res.body));
    });
  3. Run the script and argue a four-digit random year. The service should tell you if it is a leap year.
    bash $ node repro.js 2016

  4. Observe Charles. There is one redirect (the Google Apps Engine requires this) but then the service returns 200, with a small JSON response.

Expected: Needle should run the callback and the console.log should execute, or at least an exception should throw.
Actual: The callback never runs.

I've been tracing this and it appears to be happening inside the JSON parser TransformStream in parsers.js. Its _transform function gets called, so the HttpMessage stream is fine, but its _flush function does not. It seems like Charles in SSL mode might fail to send whatever terminating message triggers Node's HTTPS client to end its response stream. Could the Proxy-Connection header be at fault here?

from needle.

tomas avatar tomas commented on July 19, 2024

Holy mac! Once I get my hard hat I'll take a look into this, hehe.

from needle.

zetlen avatar zetlen commented on July 19, 2024

Hey, any luck on this? I could open a pull request to cover the timeout failure case, but the fix I have in mind is not so good.

from needle.

ostriandoni avatar ostriandoni commented on July 19, 2024

i still get this error:

2018-05-21T02:27:42.447149+00:00 app[web.1]: { Error: write EPROTO 139950560855872:error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error:../deps/openssl/openssl/ssl/s23_clnt.c:769:
2018-05-21T02:27:42.447152+00:00 app[web.1]: 
2018-05-21T02:27:42.447155+00:00 app[web.1]:     at exports._errnoException (util.js:1050:11)
2018-05-21T02:27:42.447156+00:00 app[web.1]:     at WriteWrap.afterWrite [as oncomplete] (net.js:814:14) code: 'EPROTO', errno: 'EPROTO', syscall: 'write' }

from needle.

tomas avatar tomas commented on July 19, 2024

Yikes! Bringing this issue back from the dead...

from needle.

tomas avatar tomas commented on July 19, 2024

@zetlen Sorry for the insanely late response, but since this issue was marked as closed I hadn't noticed it. Would you mind opening a PR with the fix you mentioned earlier? :)

from needle.

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.