In active FTP mode, the server initiates a data connection to the client. If the client is behind an HTTP proxy, this obviously won't work. In passive FTP mode it is the client who initiates both the initial and the data connections. Since HTTP proxies can tunnel arbitrary outgoing TCP connections (using the CONNECT method), it should be possible to access an FTP server in passive mode via an HTTP proxy.
The FtpWebRequest
seems to support passive mode. However, I don't understand why file download and directory listings are supported, whereas file upload, which also uses the same data connection, is not.
Have you confirmed that FtpWebRequest
configured for passive mode does not work via an HTTP proxy through which directory listings/file download work just fine?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…