How to connect to ftp server via proxy using ftplib????

Tim Williams listserver at
Wed Oct 20 12:46:49 CEST 2004

----- Original Message ----- 
From: "BruceKL WhoH" <BruceWhoHKL at>

> Hi,all
>      I am trying to write a simple ftp client, and
> I found ftplib module. But my app needs to connect to server
> via proxy, I cannot find the way to do this using ftplib .
> As we know ,most ftp client app(such as FlashFXP,CuteFtp) can connect to
ftp server via proxy.
> How to do this?
>      Please point me in the right direction. Thanks in advance.

Depends on the proxy,  but a common method is to ftp to the proxy,  then use
user at real-server as the user name, and the original password

EG  for

ftp proxyserver  (or open proxyserver from with ftp)
user anonymous at
pass xxxxx

... so

from ftplib import FTP
site = FTP('my_proxy')
msg = site.login('anonymous at', 'password')



More information about the Python-list mailing list