WorldWind Source Analysis Series: Agent Helper Class Proxyhelper

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.