# Webrick proxy server and streaming

**URL:** <https://www.ruby-forum.com/t/webrick-proxy-server-and-streaming/148614>\
**Category:** Ruby\
**Created:** [September 15, 2008, 4:35pm UTC](https://www.ruby-forum.com/t/webrick-proxy-server-and-streaming/148614 "2008-09-15T16:35:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@samba](https://www.ruby-forum.com/u/samba)\
**Post date:** [September 15, 2008, 4:35pm UTC](https://www.ruby-forum.com/t/webrick-proxy-server-and-streaming/148614/1 "2008-09-15T16:35:55Z")

</div>

Hi,

I ran webrick proxy server snippet found on [webrick.org](http://webrick.org) site. It was  
working fine except with streaming or large files. Rather than handing  
over data to browser as it gets it downloading entire file and then  
flushing entire file to client. Is it possible to webrick to hand  
over data to client as it gets ?, So that streaming and progressive  
loading at client side work as expected ?

#!/usr/local/bin/ruby  
require ‘webrick/httpproxy’

s = WEBrick::HTTPProxyServer.new(  
:Port =\> 2020,  
:RequestCallback =\> Proc.new{|req,res|  
puts “-”\*70  
puts req.request\_line, req.raw\_header  
puts “-”\*70  
}  
)  
trap(“INT”){ s.shutdown }  
s.start

---

<div class="post-metadata">

**Author:** ![samba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@samba](https://www.ruby-forum.com/u/samba)\
**Post date:** [September 15, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/webrick-proxy-server-and-streaming/148614/2 "2008-09-15T16:47:08Z")

</div>

On Sep 15, 7:32 pm, samba [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> require ‘webrick/httpproxy’  
> s.start  
> BTW you can use youtube for testing streaming behavior.
