Thanks for the links. I allready gone through the links and found solution. It should as follows.... HINTERNET hOpenHandle, hConnectHandle, hResourceHandle;WORD dwError, dwErrorCode; hOpenHandle = InternetOpen(NULL,INTERNET_OPEN_TYPE_PROXY, _T("192.168.9.10:8080"), NULL, INTERNET_FLAG_SECURE); // _T("192.168.9.10:8080") is proxy with port number DWORD dwServiceType = AFX_INET_SERVICE_HTTP; CString szServer, szObject; INTERNET_PORT nPort; AfxParseURL (strURL, dwServiceType, szServer, szObject, nPort); // strURL is any URL whose data to retrieve say http://www.google.com hConnectHandle = InternetConnect(hOpenHandle,szServer,INTERNET_INVALID_PORT_NUMBER, _T("test1"), _T("test"), INTERNET_SERVICE_HTTP, 0, 0); // _T("test1"), _T("test") is username and password for proxy at my server hResourceHandle = HttpOpenRequest(hConnectHandle, _T("GET"), szObject, NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); resend: HttpSendRequest(hResourceHandle, NULL, 0, NULL, 0); DWORD dwStatus; DWORD dwStatusSize = sizeof(dwStatus); HttpQueryInfo(hResourceHandle, HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, NULL); dwErrorCode = hResourceHandle ? ERROR_SUCCESS : GetLastError(); dwError = InternetErrorDlg(this->GetSafeHwnd(), hResourceHandle, dwErrorCode, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS | FLAGS_ERROR_UI_FLAGS_GENERATE_DATA, NULL); if (dwError == ERROR_INTERNET_FORCE_RETRY) goto resend; DWORD dwNumberOfBytesRead; char sz[1024]; int result; do { result = InternetReadFile(hResourceHandle, sz, 1023, &dwNumberOfBytesRead); sz[dwNumberOfBytesRead] = '\0'; int x = strlen(sz); strResult += sz; memset(sz, 0, 1024); } while(result && dwNumberOfBytesRead != 0); return strResult; I was trying/searching this for two days and finally this is done. For others who want proxy authentication, can refer this code. But still there has to be a way by using CInternetSession as it is wrapper to WinInet API's used above. I am happy now that code is working fine now. Thanks once again for your help.