Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8227525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:09:13+00:00 2026-06-07T16:09:13+00:00

I am using node-curl as a HTTPS client to make requests to resources on

  • 0

I am using node-curl as a HTTPS client to make requests to resources on the web and the code runs on a machine behind a proxy facing the internet.

The code I am using to co:

var curl = require('node-curl');
//Call the curl function. Make a curl call to the url in the first argument.
//Make a mental note that the callback to be invoked when the call is complete 
//the 2nd argument. Then go ahead.
curl('https://encrypted.google.com/', {}, function(err) {
    //I have no idea about the difference between console.info and console.log.
    console.info(this.body);
});
//This will get printed immediately.
console.log('Got here'); 

node-curl detects the proxy settings from the environment and gives back the expected results.

The challenge is: the callback gets fired after the entire https-response gets downloaded, and as far as I can tell there are no parallels for the ‘data’ and ‘end’ events from the http(s) modules.

Further, after going through the source code, I found that indeed the node-curl library receives the data in chunks: reference line 58 in https://github.com/jiangmiao/node-curl/blob/master/lib/CurlBuilder.js . It seems that no events are emitted presently in this case.

I need to forward the possibly-sizable-response back to the another computer on my LAN for processing, so this is a clear concern for me.

Is using node-curl recommended for this purpose in node?

If yes, how can I handle this?

If no, then what would be a suitable alternative?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:09:14+00:00Added an answer on June 7, 2026 at 4:09 pm

    I would go for the wonderful request module, at least if the proxy settings are no more advanced than what it supports. Just read the proxy settings from the environment yourself:

    var request = require('request'),
        proxy = request.defaults({proxy: process.env.HTTP_PROXY});
    
    proxy.get('https://encrypted.google.com/').pipe(somewhere);
    

    Or if you don’t want to pipe it:

    var req = proxy.get({uri: 'https://encrypted.google.com/', encoding: 'utf8'});
    
    req.on('data', console.log);
    req.on('end', function() { console.log('end') });
    

    Above, I also pass the encoding I expect in the response. You could also specify that in the defaults (the call to request.defaults() above), or you could leave it in which case you will get Buffers in the data event handler.

    If all you want to do is to send it to another URL, request is perfect for that:

    proxy.get('https://encrypted.google.com/').pipe(request.put(SOME_URL));
    

    Or if you’d rather POST it:

    proxy.get('https://encrypted.google.com/').pipe(request.post(SOME_URL));
    

    Or, if you want to proxy the request to the destination server as well:

    proxy.get('https://encrypted.google.com/').pipe(proxy.post(SOME_URL));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using node-http-proxy . However, in addition to relaying HTTP requests, I also
In Node.js , other than using child process to make CURL call, is there
When using node.js to e.g. serve requests for a backbone.js front end, would node.js
I'm successfully using Node.js + Express + Everyauth ( https://github.com/abelmartin/Express-And-Everyauth/blob/master/app.js ) to login to
I'm using node.js to make a http request to a host. I found the
I am using node.js v. 0.4.8. When I create a HTTPS server, I never
I'm using node.js and express to handle HTTP requests and responses. By using the
I'm using Node.js 0.6.9, and am trying to send a datagram broadcast package. Code:
I'm using node.js and backbone for a web app. Backbone is part of my
I am using node.js socket.io-client and socket.io . I have a javascript program which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.