🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #400

Re: IdFTPServer server and firewall

#400
From: Remy Lebeau (TeamB)
Date: Wed, 09 Apr 2008 06:21
34 lines
2343 bytes
"roladdon" <roladdon@PutMyServerHere.ca> wrote in message 
news:47fc471d$1@newsgroups.borland.com...

> IdFTPServer1PASVReply(TIdFTPServerContext *ASender,  AnsiString &VIP, WORD 
> &VPort, const TIdIPVersion AIPVer)
> {
> VIP = "65.94.66.176";  // my public IP
> }
>
> VIP seems to be set to the local IP.

Yes, it is the local IP by default.  That is be design.  TIdFTPServer has no 
way of knowing that it is running behind a router or not.  If TIdFTPServer 
were running on a machine that is directly connected to the Internet, then 
the default IP works fine.  Otherwise, the OnPASVReply exists so you can 
override the default yourself when needed.

> where in the FTPServer component is the best place to get the public IP 
> from.

TIdFTPServer does not know the public IP when running behind a router.  It 
is your responsibility to provide that to it when requested by the 
OnPASVReply event.

> - it is already known - because the client already connected on port 21

The client knows the IP.  TIdFTPServer does not.  It only knows the local 
IP(s) that it is directly listening on.  When TIdFTPServer is running behind 
a router, then the IP(s) are completely different than the IP that the 
client connects to.


Gambit 
Technical Details
Message-ID: <47fc6112$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeeder.dynfx.net!weretis.net!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <47fbd697@newsgroups.borland.com> <47fbdfde$1@newsgroups.borland.com> <47fc0c8a@newsgroups.borland.com> <47fc0dc4$1@newsgroups.borland.com> <47fc1653@newsgroups.borland.com> <47fc471d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,3bf5299e11a8ee87
X-Google-Attributes: gid11508e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <47fbd697@newsgroups.borland.com> <47fbdfde$1@newsgroups.borland.com> <47fc0c8a@newsgroups.borland.com> <47fc0dc4$1@newsgroups.borland.com> <47fc1653@newsgroups.borland.com> <47fc471d$1@newsgroups.borland.com>
Subject: Re: IdFTPServer server and firewall
Date: Tue, 8 Apr 2008 23:21:33 -0700
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 76.89.173.41
Message-ID: <47fc6112$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1207722258 76.89.173.41 (8 Apr 2008 23:24:18 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeeder.dynfx.net!weretis.net!news.isoc.lu!newsgroups.borland.com!not-for-mail