Re: FTP passive connection between client and server running in different local networks

Giganews Newsgroups
Subject: Re: FTP passive connection between client and server running in different local networks
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Wed, 16 Sep 2009

"Tomasz B" <t.berg.REMO…@slican.pl> wrote in message
news:2B7B9BFDF590E340t.berg.REMO…@slican.pl...

> Is it possible to force idFtp to alter ip address sending by server as a
> respond on PASV command when returning address is a private ip and
> idFtp.Host contains public ip?

If you are using Indy 10, you can set the TIdFTP.PassiveUseControlHost
property to True.

> My situation looks like:
> client (local ip) -- gateway* -- internet -- gateway2* --  server (local
> ip)

It is the server's responsibility to provide the public IP of gateway2 in
its PASV reply.  If the server is not doing that, then it is not configured
properly.

> FTP communication between IdFTp and IdFtpServer works if command
> port is in use (so it's possible to list directories).

TIdFTPServer has an OnPASVReply event available that allows your code to
control which IP is reported to the client.

--
Remy Lebeau (Indy Team)

Replies

In response to

FTP passive connection between client and server running in different local networks posted by Tomasz B on Wed, 16 Sep 2009