Freigeben über


WinHttp Proxy Settings in 64 Bit (x64) Environments

There are two settings for WinHttp Proxy settings for a 64 Bit OS.  One applies to the 64 bit environment and one for the 32 bit environment.  You can use netsh for Windows 2008, Windows 7 and later OSes and proxycfg.exe for earlier OSes.  If you are confused and not sure where your WinHttp application is reading proxy settings from, the easiest way to determine where WinHttp is reading proxy settings from is to use procmon (process monitor).

To set the x64 WinHttp settings using netsh.exe, simply open a command prompt and type ‘netsh winhttp set proxy’ and set your proxy there (if you do not supply arguments it gives you some examples).  This will run the 64 bit version of netsh from the System32 directory.

To set the 32 bit (x86) WinHttp settings, open a command prompt and navigate to the Windows\SysWOW64 directory and run netsh there.

For proxycfg.exe you need to run proxycfg from the command line (system32 dir by default so x64 code) or the proxycfg from the c:\windows\sysWow64\ directory (x86 – 32bit).

 

For another issue with the WinHttp COM object you can refer to my earlier post here: https://blogs.msdn.com/b/jpsanders/archive/2009/07/21/winhttp-proxy-configuration-on-windows-2003-x64.aspx

Let me know if this helps you!

Comments

  • Anonymous
    January 25, 2011
    This article is really helps me ! Its solved my problem at Win7 x64 and  Vista x64. I just want to say thanks.

  • Anonymous
    April 20, 2012
    Hi jpsanders, I tried to set the proxy through both system32netsh.exe and sysWoW64netsh.exe but it seems does not work. I run http://www.whatismyip.com from both ie 9, the proxy is not detected. I tried from firefox with no luck either. I did check the proxy log, there's no request to the proxy. I don't set proxy to both ie and firefox so I assume both ie and firefox will simply ignore this setting? Thanks

  • Anonymous
    April 22, 2012
    Hi Anung, IE uses WinINet and has its own proxy settings.  You can set IE proxy settings through the IE Options.  This blog post is specific to WinHttp and is used for programs using WinHttp only. -Jeff

  • Anonymous
    June 04, 2012
    Thanks jpsanders! This helped us a lot.

  • Anonymous
    July 25, 2012
    This issue has been addressed in Windows 8. Calling either netsh will set the proxy for both 32bit and 64bit WinHTTP clients.

  • Anonymous
    November 04, 2015
    The comment has been removed