# How can I use hpricot with proxy and provide username info?

**URL:** <https://www.ruby-forum.com/t/how-can-i-use-hpricot-with-proxy-and-provide-username-info/152837>\
**Category:** Ruby\
**Created:** [November 7, 2008, 10:55pm UTC](https://www.ruby-forum.com/t/how-can-i-use-hpricot-with-proxy-and-provide-username-info/152837 "2008-11-07T22:55:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cswebgrl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Post date:** [November 7, 2008, 10:55pm UTC](https://www.ruby-forum.com/t/how-can-i-use-hpricot-with-proxy-and-provide-username-info/152837/1 "2008-11-07T22:55:41Z")

</div>

Hi.

I am using hpricot, but I want to send this through a proxy server.

I’ve used mechanize through a proxy without a problem, but I don’t need  
it for this code.

Currently I have

doc = Hpricot(open(location, :proxy =\>  
‘[http://www.proxyserver.com:8080](http://www.proxyserver.com:8080)’,  
:http\_basic\_authentication =\> [‘username,password’]))

Any ideas why I’m get a 407 Proxy Authentication error and how to solve  
it?

Thanks!
