Configuring WinHTTP Proxy

Overview


There are two main types of Windows proxy settings: one is the proxy setting found in Internet Options, etc., and the other is the WinHTTP Proxy proxy setting.

The features of each are summarized below.

Item Description
Internet Options Configure in Internet Options, or in Windows 10/11, from the Settings app.
Set per user.
Typical applications used are browsers such as Chrome and Edge.
WinHTTP Proxy Configure by command.
Set for the system.
It is used for Windows Update and Microsoft Store.

Local Area Network (LAN) Settings
Edit proxy server

In many corporate networks, Internet connections are configured via a proxy server. In such cases, the above proxy configuration is required.

This article presents an example of WinHTTP Proxy configuration using the Netsh command and PowerShell cmdlets.




In case of Netsh command

Check the settings

To check the proxy settings, run netsh winhttp show proxy.

1netsh winhttp show proxy
2
3Current WinHTTP proxy settings:
4
5    Direct access (no proxy server).
6 

Settings

To set the proxy, run netsh winhttp set proxy.
The <local> in the example corresponds to "Do not use a proxy server for local addresses".

1netsh winhttp set proxy <proxy-server> <bypass-list>
2
3netsh winhttp set proxy http://proxy.mnotes.net:8080 "192.168.*.*;*.mnotes.net;<local>"
4
5Current WinHTTP proxy settings:
6
7    Proxy Server(s) :  http://proxy.mnotes.net:8080
8    Bypass List     :  192.168.*.*;*.mnotes.net;<local>
9 

Importing Internet Option settings

To import internet option settings, run netsh winhttp import proxy.

1netsh winhttp import proxy ie
2
3Current WinHTTP proxy settings:
4
5    Proxy Server(s) :  http://proxy.mnotes.net:8080
6    Bypass List     :  192.168.*.*;*.mnotes.net;<local>
7 

Delete the settings

To delete the proxy settings, run netsh winhttp reset proxy.

1netsh winhttp reset proxy
2
3Current WinHTTP proxy settings:
4
5    Direct access (no proxy server).
6 

In case of Powershell cmdlet

Check the settings

To check the proxy settings, run Get-WinhttpProxy -Default.

1Get-WinhttpProxy -Default
2
3Current WinHTTP proxy settings:
4
5    Direct access (no proxy server).
6 

Settings

To set the proxy, run Set-WinhttpProxy.
The <local> in the example corresponds to "Do not use a proxy server for local addresses".

1Set-WinhttpProxy -ProxyServer <proxy-server:port> -BypassList <bypass-list>
2
3Set-WinhttpProxy -ProxyServer "http://proxy.mnotes.net:8080" -BypassList "192.168.*.*;*.mnotes.net;<local>"
4
5Current WinHTTP proxy settings:
6
7    Proxy Server(s) :  http://proxy.mnotes.net:8080
8    Bypass List     :  192.168.*.*;*.mnotes.net;<local>
9 

Delete the settings

To delete the proxy settings, run Reset-WinhttpProxy -Direct.

1Reset-WinhttpProxy -Direct
2
3Current WinHTTP proxy settings:
4
5    Direct access (no proxy server).
6 

Translations: