The agent helper class proxyhelper a number of WIN32 structures and functions through interoperability techniques called platform invoke. The class diagram is as follows.
The main processing methods provided are basically static functions, which are briefly described as follows:
The inline type winhttp_autoproxy_options represents the WIN32 structure of the automatic proxy option.
The inline type Winhttp_proxy_info represents the agent information structure returned by the WinHTTP Interop.
static extern IntPtr WinHttpOpen () Marshals the open Windows HTTP service function in the Win32 dynamic link library.
The static extern bool Winhttpclosehandle (INTPTR hinternet) marshals the shutdown Windows HTTP service function in the Win32 dynamic link library.
The static extern bool Winhttpgetproxyforurl () Marshals the function of the HTTP service in the WIN32 dynamic-link library to get the proxy for the URL.
static void Openwinhttpsession ()//Open Windows HTTP Service session
static void Closewinhttpsession ()//Shutdown Windows HTTP Service session
Static ICredentials determinecredentials (string name, string password, string domain) set credentials based on the given parameter network request
Static IWebProxy Determineautoproxyforurl (String targeturl, string proxyscripturl, ref int errorCode) Automatically or by downloading and running a specific script to determine the dynamic proxy URL string
public static IWebProxy Determineproxyforurl () determines the proxy URL string and sets the IWebProxy class with the trusted credentials built by the relevant parameters
WorldWind Source Analysis Series: Agent Helper Class Proxyhelper