TIdHTTP exposes OnProxyAuthorization for the point where a proxy authentication mechanism asks the application to supply an account. The callback receives a TIdAuthentication object and a Handled result:

procedure TForm1.IdHTTP1ProxyAuthorization(Sender: TObject;
  Authentication: TIdAuthentication; var Handled: Boolean);
begin
  Authentication.Username := 'PROXY_USER';
  Authentication.Password := 'PROXY_PASSWORD';
  Handled := True;
end;

Use the IdAuthentication unit for the type and assign this method to the HTTP component's OnProxyAuthorization event. Replace the placeholder values with the account supplied by the application's credential logic.

Returning Handled=true lets the authentication mechanism continue with those values. Return false when the user cancels or the application declines to supply a credential.

The proxy endpoint still belongs in the component's ProxyParams configuration. The callback participates in the selected scheme's exchange; it does not need to calculate a Basic or NTLM header itself.

ХӀокхунах тера йаззамаш