<html><body><div>Hello Garri,</div><div>Thank You for explain Squid and FTP.</div><div>1. Directive read_timeout work OK</div><div>2. I will sometime upgrade Squid to ver. 3.5</div><div><br></div><div>Thank You</div><div>Ludek</div><div><br></div><div><br></div><p>---------- Původní zpráva ----------<br>Od: Garri Djavadyan <garryd@comnet.uz><br>Komu: squid-users@lists.squid-cache.org<br>Datum: 23. 11. 2016 7:58:09<br>Předmět: Re: [squid-users] FTP interrupted</p><br><blockquote>On Wed, 2016-11-23 at 07:17 +0100, ludek_coufal wrote:<br>> Hello Garri,<br>> client FTP - Total Commander (I test WinSCP, FileZilla with same<br>> result - after 15 min connection interrupted) with proxy server -<br>> proxy server HTTP with FTP support:<br>> part of squid.conf:<br>> *********************************************************************<br>> ******************<br>> acl SSL_ports port 21<br>> acl SSL_ports port 1024-65535<br>> acl SSL_ports port 443<br>> acl SSL_ports port 8443<br>> acl SSL_ports port 6400<br>> acl Safe_ports port 80  # http<br>> acl Safe_ports port 21  # ftp<br>> acl Safe_ports port 443  # https<br>> acl Safe_ports port 70  # gopher<br>> acl Safe_ports port 210  # wais<br>> acl Safe_ports port 1025-65535 # unregistered ports<br>> acl Safe_ports port 280  # http-mgmt<br>> acl Safe_ports port 488  # gss-http<br>> acl Safe_ports port 591  # filemaker<br>> acl Safe_ports port 777  # multiling http<br>> acl CONNECT method CONNECT<br>> acl FTP proto FTP<br>> always_direct allow FTP<br>> <br>> http_access deny !Safe_ports<br>> # Deny CONNECT to other than secure SSL ports<br>> http_access deny CONNECT !SSL_ports<br>> # Only allow cachemgr access from localhost<br>> http_access allow localhost manager<br>> http_access deny manager<br>> <br>> ###############<br>> # http_access deny localnet !bandwidth_auth<br>> ###############<br>> http_access allow localhost<br>> <br>> # And finally deny all other access to this proxy<br>> http_access deny all<br>> # Squid normally listens to port 3128<br>> #http_port 3128 transparent<br>> http_port 3128<br>> ftp_port 21<br>> # Uncomment and adjust the following to add a disk cache directory.<br>> #cache_dir ufs /var/log/squid/cache 100 16 256<br>> # Leave coredumps in the first cache dir<br>> coredump_dir /var/log/squid/cache<br>> #<br>> # Add any of your own refresh_pattern entries above these.<br>> #<br>> refresh_pattern ^ftp:  1440 20% 10080<br>> refresh_pattern ^gopher: 1440 0% 1440<br>> refresh_pattern -i (/cgi-bin/|\?) 0 0% 0<br>> refresh_pattern .  0 20% 4320<br>> logfile_rotate 2<br>> *********************************************************************<br>> ****<br>> When I add ftp_port 21 in squid.conf and proxy.reload I get this<br>> message:<br>> /etc/squid/squid.conf:129 unrecognized: 'ftp_port'<br>> I found this: http://www.squid-cache.org/Doc/config/ftp_port/<br>> Our version is  Squid Cache ver. 3.3.8<br><br>Hi Ludek,<br><br>With the above config, your FTP clients use CONNECT methods. Squid<br>simply tunnels connections from FTP client to FTP server. When you<br>upload a file over FTP data channel, FTP control channel is idle and<br>Squid terminates the control connection after 15 minutes [1] by<br>default. It is because Squid don't know about relations between<br>tunneled control channel and data channel. You can try to increase<br>default timeout. But more elegant solution is to use FTP relay function<br>(ftp_port).<br><br>The ftp_port directive only available in Squid-3.5 and above. You<br>should upgrade Squid to latest 3.5.22 as Eliezer already advised you.<br><br>When you configure ftp_port, in Filezilla you should disable<br>connection->generic proxy and enable connection->ftp->ftp proxy with<br>following settings:<br><br>Type: custom<br>---<br>USER %u@%h<br>PASS %p<br>---<br>Proxy host: Squid's IP adress<br><br><br>[1] http://www.squid-cache.org/Doc/config/read_timeout/<br><br><br>Garri<br>_______________________________________________<br>squid-users mailing list<br>squid-users@lists.squid-cache.org<br>http://lists.squid-cache.org/listinfo/squid-users</blockquote></body></html>