How to send http request to remote server goes through proxy (WAP gateway) using the API InternetOpen, InternetConnect? Thanks.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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!"));
}
.



Relevant Pages

  • J2ME, HttpConnection and Proxy
    ... just doesn't want to pass HTTP requests through a proxy. ... the same small J2ME app. ... } catch (Exception ex) { ... Internet, without proxy, J2ME HTTP request works just fine. ...
    (comp.lang.java.programmer)
  • Newbie Questions: How to set the proxy to download files by ftp protocol?
    ... I want to download a log file from the remote server, ... the firewall. ... so I need to access the remote server by proxy. ... failed to figure out what's the correct way to set the proxy. ...
    (comp.lang.ruby)
  • Hosting with IIS and <add> Element for <bypasslist>
    ... This does not seem to work for remoting to a remote server hosted by IIS. ... One of our clients uses a proxy and it's blocking traffic (407 Proxy ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Relaying acctg records with IAS
    ... IAS sees to a remote server? ... Making IAS a proxy is ... You can forward accounting requests only to remote servers with IAS and ...
    (microsoft.public.internet.radius)
  • Re: BizTalk Deployment Wizard and HTTP ports
    ... although I guess this has nothing to do with the proxy ... but rather with the credentialset when doing the actual HTTP request. ... > the SSO refers to the secure storage rather then a mapping between ... Ideally I'd like to use anonymous authentication and SSO for the proxy ...
    (microsoft.public.biztalk.general)