Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8006779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:37:32+00:00 2026-06-04T17:37:32+00:00

It should be added to the project check the validity of proxy servers. The

  • 0

It should be added to the project check the validity of proxy servers. The algorithm works is simple:
1. I’m trying to connect to a specific server via a proxy.
2. I get the page contents (the address).
3. Connecting to the same server directly.
4. Compare their addresses if they match the proxy is not anonymous.

But for some reason after the program to connect to the proxy first, thenattempt to get a connection through another proxy or directly is not successful. When I read the address you always get the address of the first proxy.
After some time trying to run the test, checking all begins to work properly.but enough to restart Windows and start all over again.

What am I doing wrong?
Project http://dl.dropbox.com/u/10669949/work/internet_site.zip

CString CDataSender::GetNotDirect(CString proxy)
{
    try
    {
        auto_ptr<CString> proxyip(new CString);
        CString page ="/ip.php";
        CString host="176.65.165.57";
        if (proxy.IsEmpty()) return "";

        auto_ptr<CInternetSession> iProxy (new CInternetSession("Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.8.131 Version/11.11",1,INTERNET_OPEN_TYPE_PROXY,proxy));
        auto_ptr<CHttpConnection> pH(iProxy->GetHttpConnection(host,INTERNET_FLAG_DONT_CACHE|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_PRAGMA_NOCACHE,80));
        auto_ptr<CHttpFile> pF(pH->OpenRequest("GET",page));
        pF->SendRequest();
        pF->ReadString(*proxyip);
        iProxy->Close();
        pH->Close();
        pF->Close();
        return *proxyip;
    }
    catch(CInternetException *pEx)
    {
        cout<<pEx->m_dwError<<endl;
        return "";
    }
}


CString CDataSender::GetDirect()
{       
    try
    {
        auto_ptr<CString> directip(new CString);
        int nCount=0;

        CString page ="/ip.php"; 
        CString host="176.65.165.57";   
        auto_ptr<CInternetSession> iDirect(new CInternetSession (/*"Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.8.131 Version/11.11"*/"",1,INTERNET_OPEN_TYPE_DIRECT));
        auto_ptr<CHttpConnection> pH(iDirect->GetHttpConnection(host,INTERNET_FLAG_DONT_CACHE|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_PRAGMA_NOCACHE,80));
        auto_ptr<CHttpFile> pF(pH->OpenRequest("GET",page));
        pF->SendRequest();
        pF->ReadString(*directip);
        iDirect->Close();
        //////////////////////////////////////////////////////////////////////////
        pH->Close();
        pF->Close();
        return *directip;
    }
    catch(CInternetException *pEx)
    {       
        cout<<pEx->m_dwError<<endl;
        return "";
    }

}



int CDataSender::CheckProxy(CString proxy)
{       
    CString directip="",proxyip="";
    proxyip.Empty();directip.Empty();
    proxyip=GetNotDirect(proxy);
    if(proxyip!="")
        directip=GetDirect();
    else
        return -1;
    cout<<"Direct: "<<directip<<endl;
    cout<<"Proxy: "<<proxyip<<endl;
    if ((proxyip!="")&&(directip!="")&&(proxyip.Find("html")==-1)&&/*(proxyip.GetLength()<16) &&*/(proxyip.Find(directip)==-1) /*|| proxyip=="1.1.1.1"*/) 
    {
        return 1;
    }
    return -1;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:37:33+00:00Added an answer on June 4, 2026 at 5:37 pm

    Solved the problem. Added the appropriate flags.

    auto_ptr<CHttpConnection> pH(iDirect->GetHttpConnection(host,INTERNET_FLAG_RELOAD|INTERNET_FLAG_DONT_CACHE|INTERNET_IDENTITY_FLAG_CLEAR_CONTENT|INTERNET_IDENTITY_FLAG_CLEAR_DATA|INTERNET_IDENTITY_FLAG_CLEAR_COOKIES,80));
        auto_ptr<CHttpFile> pF(pH->OpenRequest("GET",page,NULL,1,NULL,NULL,INTERNET_FLAG_RELOAD|INTERNET_FLAG_DONT_CACHE|INTERNET_IDENTITY_FLAG_CLEAR_CONTENT|INTERNET_IDENTITY_FLAG_CLEAR_DATA|INTERNET_IDENTITY_FLAG_CLEAR_COOKIES));
    

    Similarly, for another function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to import an existing Android Project(a small App that should be added
This link states that all columns that are nullable should be added to the
I want my script to define an empty array. array values should be added
Is there a way to specify which namespace includes should be automatically added any
should be simple right? but have not found any anwsers :
I added the QuartzCore framework to my ios 5.0 project and then tried [self
I'm running a simple Java program with below directory structure: MyProject (A project in
I have a .NET Setup Project to which I've added a custom installer action.
1) I did git init in a folder 2) added some project files 3)
I am trying to use Ant and Maven to build a project. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.