Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Indy TCPClient-Verbindung über Proxy (https://www.delphipraxis.net/170067-indy-tcpclient-verbindung-ueber-proxy.html)

hesch21 29. Aug 2012 11:27


Indy TCPClient-Verbindung über Proxy
 
Hallo liebe Netzspezialisten

eigentlich ein einfaches Problem: Mein Programm soll sich für eine Lizenzkontrolle an meinem Server anmelden. Das funktioniert auch
- wenn keine Proxy-Einstellungen vorhanden sind
- bei Proxy-HTTP oder Poxy-Socks mit Eingabe von User und Passwort

Es funktioniert aber nicht bei Vorhandensein eines PAC-Scripts. Ich habe mich etwas schlau gemacht und bin nicht gewillt, diese JAVA-Datei zu parsen zumal die PAC-Dateien so oder so veraltet sind.

Was ich aber mehrmals schon gesehen habe, ist bei anderen Produkten, dass sich diese verbinden können, sobald der Benutzer einen IE geöffnet, sich auf einer wirklichen WEB-Seite (z.B. Google) angemeldet und somit auch sein Username und Passwort für die Internet-Verbindung (Proxy) eigegeben hat. Also so als ob man sich an diese Verbindung 'anhängen' würde oder von da die Einstellungen übernehmen würde. Es ist auch keine Identifikation mehr erforderlich. Wer das prächtig beherrscht, ist zum Beispiel TeamViewer.

Und das würde mich generell interessieren, nicht nur im Fall von PAC-Scripts. Auch im Fall von einem normalen Proxy macht es ja keinen Sinn, wenn sich der Benutzer nochmals identifizieren muss, wenn er bereits im Internet hängt.

Hat jemand eine Idee, wie man diese Werte einer laufenden Verbindung auslesen/übernehmen kann?

kuba 20. Apr 2013 00:38

AW: Indy TCPClient-Verbindung über Proxy
 
Das wüsste ich auch gern ...

kuba 25. Apr 2013 23:01

AW: Indy TCPClient-Verbindung über Proxy
 
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


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:15 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz