Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi IdFTP mit Proxy und ftp-through-http (https://www.delphipraxis.net/162059-idftp-mit-proxy-und-ftp-through-http.html)

Delphi-Coder 4. Aug 2011 08:06

IdFTP mit Proxy und ftp-through-http
 
Hallo,

mein Programm muss eine FTP-Verbindung über einen Proxy-Server herstellen. Dieser Proxy-Server kann FTP-Anfragen aber nur über eine ftp-through-http-Einstellung verarbeiten. Also habe ich zu meiner IdFTP-Komponente noch einen IdIOHandlerStack und einen IdConnectThroughHttpProxy hinzugefügt. Diese werden zur Laufzeit so verbunden:

Delphi-Quellcode:
FTPClient.IOHandler := IdIOHandlerStack1;
IdIOHandlerStack1.TransparentProxy := IdConnectThroughHttpProxy1;
IdConnectThroughHttpProxy1.Host   := proxysrv;
IdConnectThroughHttpProxy1.Port   := proxyport;
IdConnectThroughHttpProxy1.Enabled := true;
Leider funktioniert der FTP-Zugriff trotzdem nicht. Da ich das alles selber nicht testen kann, habe ich von einem Kunden folgenden Hinweis bekommen:

Zitat:

Im Proxy-Log sieht das so aus:
[03/Aug/2011:14:27:57 +0200] - 10.71.1.45 "-" "CONNECT www.domain.de:21 HTTP/1.0" - 1226 "" "" "-" - "-" 0.111 "-"

Wenn ich es richtig mache steht dort:
[04/Aug/2011:07:10:35 +0200] - 10.13.10.33 "-" "GET ftp://www.domain.de/ HTTP/1.1" 200 1365 "" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NETCLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)" "-" - "FTP" 0.812 "-"

Das was mein Browser versucht ist FTP- über einen HTTP-Proxy - also das was Browser schon
seid ca. 15 Jahren in genau dieser Art machen.

Das was Ihre Anwendung versucht ist eine Tunnelverbindung über diesen Proxy.
Diese Art Verbindungen ist nur bei https zulässig.

Ich bin im Moment etwas ratlos, wie ich das noch beheben könnte.
Wo liegt mein Fehler?


Viele Grüße,
Delphi-Coder

mjustin 4. Aug 2011 16:36

AW: IdFTP mit Proxy und ftp-through-http
 
Die "richtige" Protokollzeile enthält ein GET. Könnte man nicht einfach einen HTTP Client verwenden, und ein HTTP GET absetzen? Als HTTP Proxy wird dann der ftp/http proxy angegeben. Ich habe einen Hinweis auf Stackoverflow gesehen der genau das so auch empfiehlt, unter http://stackoverflow.com/questions/1...499610#6499610

Das ist aber eher trial and error - besser wäre es einen gleichartigen Server intern zu konfigurieren, z.B. Apache mit mod_proxy (http://httpd.apache.org/docs/2.0/mod/mod_proxy.html).


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:41 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