autoupgrader OnProxyAuthenticationRequest event
Return to Introduction  Previous page  Next page
Applies to
auHTTP and auAutoUpgrader components.  

Declaration
type  
  TauHTTPProxyAuthenticationRequestEvent = procedure(Sender: TObject;  
     var ProxyUsername, ProxyPassword: String;  
     var TryAgain: Boolean) of object;  
 
property OnProxyAuthenticationRequest: TauHTTPProxyAuthenticationRequestEvent;  

Description
The OnProxyAuthenticationRequest event should be used to prompt users for their username/password to access the Web via secure proxy server which requires authentication.  
 
Write this event to prompt and specify the ProxyUsername and ProxyPassword parameters, required for the proxy authentication, and set TryAgain parameter to True, to retry the HTTP query with provided login information.  
 
tip Alternatively you can specify ProxyUsername and ProxyPassword properties in the Proxy structure, before the request. In case if specified username and password is okay, the OnProxyAuthenticationRequest event will not occur.  

Notes
iiwarning If your proxy server uses some "challenge-response" authentication scheme — please make sure that ioKeepConnection option of the InternetOptions is set to True. Otherwise, connection with proxy could be dropped.  
 
iiwarning If you leave this event unhandled (if you set TryAgain parameter to False), the component will generate error code #407 (Proxy Authentication Required).  

See also
Proxy and InternetOptions properties;  
HTTP Status Codes.  
File not found.