Click to See Complete Forum and Search --> : MFC Internet Functions & PROXY!


jawed
June 7th, 1999, 12:54 PM
Hi, I've been using the CInternet functions that come with MFC very successfully to download html files from the web. Once I have an internetSession for example I can use CGetHtml (or whatever it's called) to download html files, and it works fine. However, people who are behind firewalls and go through proxy's are having a lot of trouble with my programs. They don't work there anymore. How can I consider proxy's in my code?

You can email me here: codeguru@jawed.com

---
Jawed Karim

June 7th, 1999, 01:04 PM
Here is a code fragment from my code that does what you want. cProxy is a CString that specifies the proxy server.

if(!cUseProxy)
{
session = new CInternetSession("****Client", 1,
INTERNET_OPEN_TYPE_DIRECT);
}
else
{
session = new CInternetSession("****Client", 1,
INTERNET_OPEN_TYPE_PROXY,cProxy);
}

tdg
June 7th, 1999, 07:20 PM
Check out the constructor documentation of CInternetSession. The solution will be pretty obvious then.