# Does ruby have an http proxy

**URL:** <https://www.ruby-forum.com/t/does-ruby-have-an-http-proxy/147065>\
**Category:** Ruby\
**Created:** [August 28, 2008, 8:31am UTC](https://www.ruby-forum.com/t/does-ruby-have-an-http-proxy/147065 "2008-08-28T08:31:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpc2148](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lpc2148](https://www.ruby-forum.com/u/lpc2148)\
**Post date:** [August 28, 2008, 8:31am UTC](https://www.ruby-forum.com/t/does-ruby-have-an-http-proxy/147065/1 "2008-08-28T08:31:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lpc2148](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lpc2148](https://www.ruby-forum.com/u/lpc2148)\
**Post date:** [August 28, 2008, 8:59am UTC](https://www.ruby-forum.com/t/does-ruby-have-an-http-proxy/147065/2 "2008-08-28T08:59:10Z")

</div>

Lex W. wrote:

> 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.

---

<div class="post-metadata">

**Author:** ![lpc2148](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lpc2148](https://www.ruby-forum.com/u/lpc2148)\
**Post date:** [August 28, 2008, 9:30am UTC](https://www.ruby-forum.com/t/does-ruby-have-an-http-proxy/147065/3 "2008-08-28T09:30:42Z")

</div>

Lex W. wrote:

> 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://www.google.com)”)  
{ |http|  
h,b=\*http.get(“/”)  
p h  
p h.to\_hash  
puts b  
}

---

<div class="post-metadata">

**Author:** ![lpc2148](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lpc2148](https://www.ruby-forum.com/u/lpc2148)\
**Post date:** [August 28, 2008, 6:10pm UTC](https://www.ruby-forum.com/t/does-ruby-have-an-http-proxy/147065/4 "2008-08-28T18:10:21Z")

</div>

Thomas B. wrote:

> require ‘net/http’
> 
> Net::HTTP::Proxy(proxy\_addr,proxy\_port)::start(“[www.google.com](http://www.google.com)”)  
> { |http|  
> h,b=\*http.get(“/”)  
> p h  
> p h.to\_hash  
> puts b  
> }

Isn’t that a client?
