# How to get and set the proxy of IE?

**URL:** <https://www.ruby-forum.com/t/how-to-get-and-set-the-proxy-of-ie/131463>\
**Category:** Ruby\
**Created:** [March 10, 2008, 12:04pm UTC](https://www.ruby-forum.com/t/how-to-get-and-set-the-proxy-of-ie/131463 "2008-03-10T12:04:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phoenix520](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@phoenix520](https://www.ruby-forum.com/u/phoenix520)\
**Post date:** [March 10, 2008, 12:04pm UTC](https://www.ruby-forum.com/t/how-to-get-and-set-the-proxy-of-ie/131463/1 "2008-03-10T12:04:36Z")

</div>

I want to let my program connect to internet using the proxy setting of  
IE,and I spent some time to find it in google,but nothing was found.Is  
there some way to do it?  
Any help will be appreciated!

---

<div class="post-metadata">

**Author:** ![phoenix520](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@phoenix520](https://www.ruby-forum.com/u/phoenix520)\
**Post date:** [March 10, 2008, 2:23pm UTC](https://www.ruby-forum.com/t/how-to-get-and-set-the-proxy-of-ie/131463/2 "2008-03-10T14:23:31Z")

</div>

Wu Junchen wrote:

> I want to let my program connect to internet using the proxy setting of  
> IE,and I spent some time to find it in google,but nothing was found.Is  
> there some way to do it?  
> Any help will be appreciated!

require ‘win32/registry’

def get\_proxy  
path=‘Software\Microsoft\Windows\CurrentVersion\Internet Settings’  
type, value  
=Win32::Registry::HKEY\_CURRENT\_USER.open(path).read(‘Server’)  
return value  
end

Untested, on my laptop the proxy is handled in another way (wininet.dll  
?)

Regards,

Siep

---

<div class="post-metadata">

**Author:** ![phoenix520](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@phoenix520](https://www.ruby-forum.com/u/phoenix520)\
**Post date:** [March 10, 2008, 2:28pm UTC](https://www.ruby-forum.com/t/how-to-get-and-set-the-proxy-of-ie/131463/3 "2008-03-10T14:28:58Z")

</div>

Siep K. wrote:

> Wu Junchen wrote:
> 
> > I want to let my program connect to internet using the proxy setting of

> Regards,
> 
> Siep

Should be:

require ‘win32/registry’

def get\_proxy  
path = ‘Software\Microsoft\Windows\CurrentVersion\Internet Settings’  
type, value =  
Win32::Registry::HKEY\_CURRENT\_USER.open(path).read(‘ProxyServer’) #!  
return reg\_value  
end

regards,

Siep

---

<div class="post-metadata">

**Author:** ![phoenix520](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@phoenix520](https://www.ruby-forum.com/u/phoenix520)\
**Post date:** [August 17, 2009, 6:40am UTC](https://www.ruby-forum.com/t/how-to-get-and-set-the-proxy-of-ie/131463/4 "2009-08-17T06:40:52Z")

</div>

Hi,

I need SET method. I want to set some values in ProxyServer.

Awaiting your reply

Thanks

Siep K. wrote:

> Siep K. wrote:
> 
> > Wu Junchen wrote:
> > 
> > > I want to let my program connect to internet using the proxy setting of
> 
> > Regards,
> > 
> > Siep
> 
> Should be:
> 
> require ‘win32/registry’
> 
> def get\_proxy  
> path = ‘Software\Microsoft\Windows\CurrentVersion\Internet Settings’  
> type, value =  
> Win32::Registry::HKEY\_CURRENT\_USER.open(path).read(‘ProxyServer’) #!  
> return reg\_value  
> end
> 
> regards,
> 
> Siep
