<div dir="ltr">In normal mode the server opens a connection to the FTP client; in PASV mode the client instead opens a connection to the server, so it'll work through a firewall.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 5, 2021 at 2:09 PM Joachim Durchholz <<a href="mailto:jo@durchholz.org">jo@durchholz.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am 05.01.21 um 16:54 schrieb Kees Bleijenberg:<br>
> Unfortunately is ‘working in passive mode’ not so easy (at least not to <br>
> me). After login I send the ‘pasv’ command and I get back a IP address <br>
> and a port (I assume). Do I have to create a new connection with a <br>
> handle to this new port for the stor command?<br>
<br>
Yes.<br>
<br>
> I don’t know how to do that in network.ftp.client.<br>
<br>
If network.ftp.client does not support that out of the box, you'll <br>
either have to find another library or add PASV support to it.<br>
<br>
My knowledge of the FTP protocol is pretty rusty, but I believe you the <br>
model after PASV is that you continue using normal commands but the data <br>
transfers happen over the other connection.<br>
I'd watch out for how the protocol marks the beginning and end of a data <br>
stream (it's not a single connection anymore so you lose the sequencing <br>
guarantees of TCP packets; I'd assume they either send a special packet <br>
on the data connection, or they transmit the file sizes via the normal <br>
channel).<br>
<br>
However, I can't avoid wondering why anybody would want to use the FTP <br>
protocol at all. It's so unsafe, so bottleneck-endangered, the only <br>
reason to do that would be interfacing with existing FTP servers, and <br>
even these are being phased out in favor of HTTPS, with POST for uploads.<br>
(I'm not questioning the validity of your use case, just wondering how <br>
such a use case can come up in today's world.)<br>
<br>
Regards,<br>
Jo<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>