How to send http request to remote server goes through proxy (WAP gateway) using the API InternetOpen, InternetConnect? Thanks.
- From: andy <yujianhua2002@xxxxxxxxx>
- Date: Wed, 8 Jul 2009 20:03:47 -0700 (PDT)
Hi Everyone:
I want to send a http request to remote server goes through WAP
gateway, then I need to set this WAP gateway as proxy, I use the
method InternetOpen, InternetConnect, HttpOpenRequest serial of API
to achieve it. for InternetOpen, it has the option
INTERNET_OPEN_TYPE_PROXY, I use two methods. but none of them goes
through WAP gateway, anyone who has experience on this issue please
give me some suggestion on how to force this http request goes through
proxy then proxy forward it to remote server? Any advice is welcome.
thanks in advance.
Method 1:
hOpen = InternetOpen (TEXT("WceHttp"), INTERNET_OPEN_TYPE_PROXY, TEXT
("66.209.11.61"), TEXT("66.209.11.61"), 0);
Method 2:
hOpen = InternetOpen (TEXT("WceHttp"), INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0);
if ( !hOpen )
{
// Error - Failed to Open
OutputDebugString(TEXT("Failed to open"));
}
INTERNET_PER_CONN_OPTION_LIST List;
INTERNET_PER_CONN_OPTION Option[1];
unsigned long nSize = sizeof
(INTERNET_PER_CONN_OPTION_LIST);
Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
Option[0].Value.pszValue = TEXT("http://66.209.11.61:80");
List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection = NULL;
List.dwOptionCount = 1;
List.dwOptionError = 0;
List.pOptions = Option;
if(!InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION,
&List, nSize))
{
OutputDebugString(TEXT("InternetSetOption failed!"));
}
.
- Prev by Date: Re: How to launch an application as a process on WinMobile
- Next by Date: Re: How to launch an application as a process on WinMobile
- Previous by thread: How to launch an application as a process on WinMobile
- Next by thread: Is GeoTrust broken?
- Index(es):
Relevant Pages
|