Discussion:
wininet proxy support issue
(too old to reply)
john li
2004-12-21 00:44:19 UTC
Permalink
Hello,
In my testing to ues WinInet API for HTTP proxy setting, I cannot get it
work.

If I set up my IE use non-proxy and in code, I set proxy connection and even
I *intentionally* set it to wrong IP address, it still works. Why? Here is
some snippet code. Any suggestion is appreciated.

//my ie has no proxy config. I want to use my own proxy connection.
hSession=InternetOpen(_T("my own test"),
INTERNET_OPEN_TYPE_PROXY,
_T("http=http://10.11.25.22:3129"),
NULL,
0);

hConnect = ::InternetConnect(hSession, szUrl,
INTERNET_DEFAULT_HTTPS_PORT, "", "",
INTERNET_SERVICE_HTTP, 0, 0) ;
...
in this case, I am still able to connect to http server in my code, which
confuses me. Looks like my program still uses ie connection setting instead
of mine. Did i miss something?

thanks,

John
Reymarx Gereda
2005-02-12 22:48:05 UTC
Permalink
Hi John,

The call to InternetConnect will succeed and you'll receive a connection
handle, but the "real" connection will occur when you call HTTPSendRequest,
unless it's an FTP connection.

From the msdn documentation:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetconnect.asp
"For FTP sites, InternetConnect actually establishes a connection with the
server; for others, such as Gopher, the actual connection is not established
until the application requests a specific transaction."

Thanks
Reymarx [MSFT]
Windows- Networking
This posting is provided "AS IS" with no warranties, and confers no rights
Post by john li
Hello,
In my testing to ues WinInet API for HTTP proxy setting, I cannot get it
work.
If I set up my IE use non-proxy and in code, I set proxy connection and even
I *intentionally* set it to wrong IP address, it still works. Why? Here is
some snippet code. Any suggestion is appreciated.
//my ie has no proxy config. I want to use my own proxy connection.
hSession=InternetOpen(_T("my own test"),
INTERNET_OPEN_TYPE_PROXY,
_T("http=http://10.11.25.22:3129"),
NULL,
0);
hConnect = ::InternetConnect(hSession, szUrl,
INTERNET_DEFAULT_HTTPS_PORT, "", "",
INTERNET_SERVICE_HTTP, 0, 0) ;
...
in this case, I am still able to connect to http server in my code, which
confuses me. Looks like my program still uses ie connection setting instead
of mine. Did i miss something?
thanks,
John
Continue reading on narkive:
Loading...