Einzelnen Beitrag anzeigen

Benutzerbild von kuba
kuba

Registriert seit: 26. Mai 2006
Ort: Arnsberg
588 Beiträge
 
Delphi 11 Alexandria
 
#3

AW: Indy TCPClient-Verbindung über Proxy

  Alt 25. Apr 2013, 23:01
Ich glaube ICQ kann das ...

Falls es "nur" um die Proxy Authorisierung geht hilft vielleicht dies:

Delphi-Quellcode:
procedure TForm9.IdHTTPProxyAuthorization(Sender: TObject;
  Authentication: TIdAuthentication; var Handled: Boolean);
begin
  // First check for NTLM authentication, as you do not need to
  // set username and password because Indy will automatically
  // handle passing your Windows Domain username and
  // password to the proxy server
  if Authentication is TIdSSPINTLMAuthentication then
  begin
    Handled := True;
    Exit;
  end;

  Authentication.Username := ProxyUsername;
  Authentication.Password := ProxyPassword;
  if (Authentication is TIdDigestAuthentication) then
  begin
    TIdDigestAuthentication(Authentication).Method := TIdHTTP(Sender).Request.Method;
    TIdDigestAuthentication(Authentication).Uri := TIdHTTP(Sender).URL.URI;
  end;
  Handled := True;
end;

procedure TForm9.IdHTTPSelectProxyAuthorization(Sender: TObject;
  var AuthenticationClass: TIdAuthenticationClass; AuthInfo: TIdHeaderList);
begin
  // First check for NTLM authentication
  if (AuthInfo.IndexOf('NTLM') > -1) then
  begin
    AuthenticationClass := TIdSSPINTLMAuthentication;
  end
  // Next check for Basic
  else if (AuthInfo.IndexOf('Basic') > -1) then
  begin
    AuthenticationClass := TIdBasicAuthentication;
  end
  // Then Digest
  else if (AuthInfo.IndexOf('Digest') > 0) then
  begin
    AuthenticationClass := TIdDigestAuthentication
  end;
end;
ProyUsername und ProxyPassword könnte man "hinterlegen" oder "eingeben".

KUBA
Stefan Kubatzki
E=mc2
  Mit Zitat antworten Zitat