does ruby have an http proxy

L

Lex Williams

Hi guys!

Is there an http proxy module that could be used ? For example , I would
like to point my browser through it and filter some web content using my
proxy. I know the same thing could be done using greasemonkey and the
like , but I would like to know if it can be done with ruby .

Thanks
 
J

Joel VanderWerf

Lex said:
Hi guys!

Is there an http proxy module that could be used ? For example , I would
like to point my browser through it and filter some web content using my
proxy. I know the same thing could be done using greasemonkey and the
like , but I would like to know if it can be done with ruby .

Webrick does this nicely. See sample/webrick/httpproxy.rb in the ruby
source distribution.
 
T

Thomas B.

Lex said:
Hi guys!

Is there an http proxy module that could be used ? For example , I would
like to point my browser through it and filter some web content using my
proxy. I know the same thing could be done using greasemonkey and the
like , but I would like to know if it can be done with ruby .

Thanks

require 'net/http'

Net::HTTP::proxy(proxy_addr,proxy_port)::start("www.google.com")\
{ |http|
h,b=*http.get("/")
p h
p h.to_hash
puts b
}
 

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

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top