I'm not sure why you don't use .pipe().. you don't need to buffer all the 
request before sending it. The headers should have a content-length so your 
endpoint will know about it. Just send the data directly to the other end 
instead of buffering.

-- 
Diogo Resende


On Monday, July 30, 2012 at 22:40 , axs wrote:

> Thank you, Mikeal. I use request quite a bit in my projects, and it's great. 
> However, I won't be using request for this project, because I need to write 
> this one at the transport layer. Eventually I will be redirecting various 
> requests to other servers and examining data at the transport layer. I just 
> need to make this barebones version function and then branch from it. Any 
> ideas on how to pipe the request into the socket? 
> 
> I thought of listening to the 'connection' event on the proxy server, and 
> piping the socket into the tunnel. But this won't differentiate between http 
> and https requests without parsing the request header, which I'm not sure how 
> to do.
> 
> Regards,
> Alex
> 
> On Monday, July 30, 2012 5:21:04 PM UTC-4, Mikeal Rogers wrote:
> > request does all of this, including SSL tunneling.
> > 
> > req.pipe(request(req.url, {proxy:'https://site.com'})).pipe(resp)
> > 
> > -Mikeal
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com 
> (mailto:nodejs@googlegroups.com)
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com 
> (mailto:nodejs+unsubscr...@googlegroups.com)
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to