webrick proxy server and streaming.

S

samba

Hi,

I ran webrick proxy server snippet found on 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
 
S

samba

Hi,

I ran webrick proxy server snippet found on 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

BTW you can use youtube for testing streaming behavior.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,134
Latest member
Lou6777736
Top