Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Internet access through proxy that needs username/password verification

Posted on 1998-08-26
8
Medium Priority
?
431 Views
Last Modified: 2013-11-20
Could anyone PLEASE tell me how do I access Internet through a proxy that needs username/password verification? The Microsoft FTPTREE sample doesn't work... (I can access Internet through IE4 where I get a dialog box asking me for username and password - how is that implemented?)

P.S. Yes, I'm still "dumb" - this is my 2nd week programming in MFC :-)
0
Comment
Question by:regina081698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 2

Expert Comment

by:milenvk
ID: 1321342
Try to use the MFC internet classes like CFtpConnetion and CHttpConnection or work directly with WinInet functions.
0
 
LVL 2

Expert Comment

by:milenvk
ID: 1321343
Especially consider using the InternetOpen() function - it has some proxy stuff and is one of the WinInet functions. WinInet does not have to do anything with MFC, though MFC has some wrapper classes around WinInet, but using WinInet is really easy.
0
 

Author Comment

by:regina081698
ID: 1321344
Dear milenvk, Thanks for your answer!

I know about these functions, but they do not tell me how to handle proxy requests for username and password. The proxy won't let me through without proper identity verification...

Do you know how I can do that?
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

Accepted Solution

by:
blueoak earned 100 total points
ID: 1321345
I have programmed internet applications using proxies, but these proxies don't require user name/passwords. However http and ftp requests have the username and password preceding the URL.

for example
http://username:password@www.webpage.com
ftp://username:password@ftp.ftpsite.com

Try using this format (username:password@proxyhere.proxy.com) in the proxy name string for you CInternetSession constructor.

Let me know if this solved the problem. I'm interested in it too.
0
 

Author Comment

by:regina081698
ID: 1321346
Dear blueoak,

Thanks for your suggestion. But isn't that the username and password in "ftp://username:password@ftpsite" meant for the ftpsite and not the proxy? Oh yes, do you know what happens when you http to a site like experts-exchange - you also get a login box right? So, let's say you write a program to http to this site - how would you do it, i.e. handle the username and password request from the server?

Thanks again, appreciate all the replies...

Reg.
0
 

Author Comment

by:regina081698
ID: 1321347
Sorry blueoak, missed out on the text below, ie. setting username:password@proxysite. Tried that just now. Doesn't work :-( I suspect the format username:password is handled internally by IE or Netscape... and is not a proper URL as such.)

0
 

Expert Comment

by:blueoak
ID: 1321348
As for the proxy username:pass, sorry it didn't work out. If I had a proxy account that required a username:pass, I'd test some stuff.

As for Http password requests. After you CHttpFile::SendRequest() you can call CHttpFile::QueryInfoStatusCode () which will return the result of your SendRequest(), if you recived a HTTP_ACCESS_DENIED, then you can call CHttpFile::ErrorDlg(). ErrorDlg() does some of the dirty work in resending a request with the appropriate headers and options. I can't provide the actual code, since I haven't used this class member function yet, however it should work if set up with the correct flags.
0
 

Expert Comment

by:blueoak
ID: 1321349
Before ErrorDlg() resends the request, it can prompt the user for the username/password with a message box, provided that's the situation. That's part of the dirty work I was referring to. Sorry the previous message was so vague.

You'll have to look up CHttpFile::ErrorDlg().
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question