Comments (15)
A little more info. I am running needle on:
mac osx 10.9.5
from needle.
Good point. I'll take a look and let you know what I find.
from needle.
Thanks.
from needle.
Fixed on 1e18950. Should be up on npm soon!
from needle.
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.
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.
This is already up! Sorry for not letting you know on time.
from needle.
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.
I do have access to an OSX machine. How can I reproduce the problem?
from needle.
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:
-
Run Charles.app on OSX. Make sure that SSL is configured for all hosts, and that the certificates are configured correctly.
-
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)); });
-
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
-
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.
Holy mac! Once I get my hard hat I'll take a look into this, hehe.
from needle.
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.
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.
Yikes! Bringing this issue back from the dead...
from needle.
@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)
- Incorrect parsing of complex JS nested objects in POST request HOT 5
- Mangled file content when multipart-POSTing a file with a "text/*" content type HOT 2
- Very infrequent TypeError: iconv.encodingExists is not a function
- Tunnelling doesn't work in v3.1.0 HOT 12
- Proposal: Supporting User-Defined "Follow If" Conditions
- Piping needle request to Express response won't set the correct headers
- Multiple Files Upload Renames Input Field
- Uncaught asynchronous error
- Remote end closed socket abruptly errors HOT 2
- a ':' in nonce breaks digest authentication HOT 1
- Digest MD5 not working with Geovision IP Camera
- Uncaught ECONNRESET exception
- needle.get cannot guaranty getting the http stream HOT 2
- FEATURE: Retry HOT 1
- follow_set_cookies -> not working!!!
- Bug in 3.3.0: accidental creation of `global.signal`, gets caught in strict UTs
- README recommends mikeal's request HOT 3
- Multipart uploads strips date values in the request body HOT 2
- Doesn't work in Cloudflare Workers HOT 1
- Sorry, I was about to post this issue to a different repo, don't even know how it happened that I posted it here
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from needle.