# Http io?

**URL:** <https://www.ruby-forum.com/t/http-io/102494>\
**Category:** Ruby\
**Created:** [November 16, 2005, 6:58am UTC](https://www.ruby-forum.com/t/http-io/102494 "2005-11-16T06:58:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsanson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f0a364/32.png) [@hsanson](https://www.ruby-forum.com/u/hsanson)\
**Post date:** [November 16, 2005, 6:58am UTC](https://www.ruby-forum.com/t/http-io/102494/1 "2005-11-16T06:58:10Z")

</div>

I am developing a streaming client in ruby, so far so good… now I am  
trying  
to get Net::HTTP to behave like an IO with no luck. I need Net::HTTP to  
read  
the headers as it usually does but stop at before reading the body of  
the  
page so I can read the stream in chunks and feed them to the player.

I read this article

[http://redhanded.hobix.com/inspect/theStoryOfStreamingHttpThroughMouseholeWithSubsequentAdventuresInContinuationsAndDuckTyping.html](http://redhanded.hobix.com/inspect/theStoryOfStreamingHttpThroughMouseholeWithSubsequentAdventuresInContinuationsAndDuckTyping.html)

but I can’t get it to work.

any help is appreciated…

Horacio

---

<div class="post-metadata">

**Author:** ![hsanson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f0a364/32.png) [@hsanson](https://www.ruby-forum.com/u/hsanson)\
**Post date:** [November 16, 2005, 11:38am UTC](https://www.ruby-forum.com/t/http-io/102494/2 "2005-11-16T11:38:49Z")

</div>

Horacio S. wrote:

> I am developing a streaming client in ruby, so far so good… now I  
> am trying to get Net::HTTP to behave like an IO with no luck. I need  
> Net::HTTP to read the headers as it usually does but stop at before  
> reading the body of the page so I can read the stream in chunks and  
> feed them to the player.
> 
> I read this article

[http://redhanded.hobix.com/inspect/theStoryOfStreamingHttpThroughMouseholeWithSubsequentAdventuresInContinuationsAndDuckTyping.html](http://redhanded.hobix.com/inspect/theStoryOfStreamingHttpThroughMouseholeWithSubsequentAdventuresInContinuationsAndDuckTyping.html)

> but I can’t get it to work.
> 
> any help is appreciated…

open-uri can help you - although you won’t see headers

> > require ‘open-uri’  
> > =\> true  
> > open(“[Google](http://www.google.com/index.html)”) {|io| p io.read }

Kind regards

```
robert

```
