Netsh Commands for Windows Hypertext Transfer Protocol (WINHTTP)
Applies To: Windows Server 2008
You can use commands in the netsh winhttp context to configure proxy and tracing settings for Windows HTTP. The Netsh commands for winhttp can be run manually at the netsh prompt or in scripts and batch files.
To run these commands from the command prompt, you must either enter the netsh winhttp context or prepend the context to the command. For example, if you are at the command prompt but have not typed netsh and then winhttp to enter the netsh winhttp context, you must type:
netsh winhttp command
Where command is the command that you want to run, including all of the required parameters for the command.
For information on how to interpret netsh command syntax, see Formatting Legend.
This section contains the following commands:
flush logbuffer
import proxy
reset proxy
reset tracing
set proxy
set tracing
show proxy
show tracing
Netsh winhttp commands
The following entries provide details for each command.
flush logbuffer
Flushes the internal buffers for the log files.
Syntax
flush loggbuffer
import proxy
Imports the proxy settings in the Internet Explorer Web browser's Internet Options. Importing settings from IE is the only available option
Syntax
import proxy source =ie
reset proxy
Resets the WinHTTP proxy setting to DIRECT.
Syntax
reset proxy
reset tracing
Resets the WinHTTP trace parameters to the default settings.
Syntax
reset tracing
Remarks
Following are the default WinHTTP trace parameters:
Parameter | Value |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
set proxy
Configures the WinHTTP proxy setting.
Syntax
set proxy [proxy-server=] ProxyServerName [bypass-list=] <HostsList>
Parameters
- Proxy-Server
Required. Specifies the proxy server to use for http, secure http (https), or both http and https protocols.
- Bypass-list
Optional. Specifies a list of Web sites that should be visited without utilizing the proxy server. Use "<local>" to bypass all short name hosts.
Examples
Following are three examples of how to use the set proxy command.
set proxy myproxy
set proxy myproxy:80 "<local>bar"
set proxy proxy-server="http=myproxy;https=sproxy:88" bypass-list="*.contoso.com"
set tracing
Configures the WinHTTP tracing parameters.
Syntax
set tracing [output=] file | debugger | both [trace-file-prefix=] FilePrefix [level=] default | verbose [format=] ansi | hex [max-trace-file-size=] FileSize [state=] enabled |disabled
Parameters:
- Output
Optional. Specifies whether tracing data is exported to a file, a debugger, or both.
- Trace-file-prefix
Optional. Specifies a string value that is a prefix for the log file. The file prefix can include a folder location/path. Type "*" to delete an existing prefix.
- Level
Optional. Specifies the amount of information to log.
- Format
Optional. Specifies the display format of network traffic (hexadecimal or ansi).
- Max-trace-file-size
Optional. Specifies a numeric value that is the maximum size of the trace file in bytes.
- State
Required. Specifies whether tracing is enabled or disabled.
Examples
Following are two examples of how to use the set tracing command.
set tracing trace-file-prefix="C:\Temp\Test3" level=verbose format=hex
set tracing output=debugger max-trace-file-size=512000 state=enabled
show proxy
Displays the current WinHTTP proxy setting.
Syntax
show proxy
show tracing
Displays the current WinHTTP tracing parameters.
Syntax
show tracing