InternetOpen How to use a proxy

Source: Internet
Author: User

If you use IE's default proxy settings:
Hinternet=internetopen (AfxGetAppName (), internet_open_type_proxy,null,null,0);

Change the internet_open_type_proxy into a internet_open_type_preconfig.

If you want to configure your proxy server yourself:
The 3rd parameter of the InternetOpen is set to the IP address of the proxy server:
The format of the proxy must be: [<protocol>=][<scheme>://]<proxy>[:<port>].
Where protocol,scheme://,:p ort are optional, if these three are omitted, they are http,http://,:80 by default.
That is, the HTTP proxy is the default.
The use of various commonly used agents are as follows:
Http:http=http://proxyserver:port
Ftp:ftp:ftp://proxyserver:port
Gopher:gopher=http://proxyserver:port
Socket:socks=proxyserver:port

If the agent has a username/password, you can use the following function settings:
InternetSetOption (Hhandle,internet_option_username, "",);
InternetSetOption (Hhandle,internet_option_password, "",);
To set

Http://faq.csdn.net/read/208215.html

1. Related functions:
Hinternet WINAPI InternetOpen (
LPCTSTR Lpszagent,
DWORD dwAccessType,
LPCTSTR Lpszproxy,
LPCTSTR LpszProxyBypass,
DWORD dwFlags);

BOOL WINAPI InternetSetOption (
Hinternet Hinternet,
DWORD Dwoption,
LPVOID lpbuffer,
DWORD dwbufferlength);

2. Related structures
typedef struct {
DWORD dwAccessType;
LPCTSTR Lpszproxy;
LPCTSTR LpszProxyBypass;
} internet_proxy_info, *lpinternet_proxy_info;

3. Using a proxy server
(1) Please set dwAccessType to Internet_open_type_proxy
(2) Setting Lpszproxy
(a) The format of the agent must be: [<protocol>=][<scheme>://]<proxy>[:<port>].
(b) Where protocol, scheme://,:p ort are optional, if these three are omitted, they default to
HTTP,/.,: 80. That is, the HTTP proxy is the default.
(c) Multiple proxies must be separated with "" (spaces)
(d) The use of various commonly used agents is shown below:
HTTP:
Http=http://proxyserver:port
Ftp:
Ftp:ftp://proxyserver:port
GOPHER
Gopher=http://proxyserver:port
Socks=proxyserver:port
The top three of them can be found on MSDN, but the fourth kind of I have found more than n places to finally find. It is also important to note that MSDN shows that only

InternetOpen How to use a proxy

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.