# Mechanize problem with proxies

**URL:** <https://www.ruby-forum.com/t/mechanize-problem-with-proxies/151608>\
**Category:** Ruby\
**Created:** [October 23, 2008, 1:24pm UTC](https://www.ruby-forum.com/t/mechanize-problem-with-proxies/151608 "2008-10-23T13:24:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@dani](https://www.ruby-forum.com/u/dani)\
**Post date:** [October 23, 2008, 1:24pm UTC](https://www.ruby-forum.com/t/mechanize-problem-with-proxies/151608/1 "2008-10-23T13:24:48Z")

</div>

Hi, I’m using Mechanize-0.8.4 to pass some traffic through a custom  
proxy. This proxy requires basic authentication.  
If I request [www.google.com](http://www.google.com), I will get redirected to [google.co.uk](http://google.co.uk) or  
whatever. The problem is that if the request is https, and if the  
proxy server sends a redirect (302) to the client, mechanize will  
fail:

c:/ruby/lib/ruby/1.8/net/http.rb:2106:in `error!': 302 "Moved Temporarily" (Net::HTTPRetriableError) from c:/ruby/lib/ruby/1.8/net/http.rb:2115:in `value’  
from c:/ruby/lib/ruby/1.8/net/http.rb:588:in `connect' from c:/ruby/lib/ruby/1.8/net/http.rb:557:in `do\_start’  
from c:/ruby/lib/ruby/1.8/net/http.rb:552:in `start' from c:/ruby/lib/ruby/gems/1.8/gems/mechanize-0.8.4/lib/www/mechanize.rb:450:in `fetch\_page’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/mechanize-0.8.4/lib/www/mechanize.rb:221:in  
`get’

Instead of giving this error, I would expect mechanize to follow the  
redirect, as it normally does without using a proxy.

Any hint appreciated, thanks!
