FTP File Upload with HTTP Proxy

前端 未结 13 1965
轻奢々
轻奢々 2020-12-05 07:48

Is there a way to upload a file to a FTP server when behind an HTTP proxy ?

It seems that uploading a file is not supported behind an HTTP Proxy using .Net Webclient

13条回答
  •  被撕碎了的回忆
    2020-12-05 08:07

    most FTP proxies do their thing on the connection, so if you had NO proxy, you do this:

    • server: myftpserver.com
    • user: me
    • password: pwd

    using an FTP proxy, you do:

    • server: ftpproxy.mydomain.com
    • user: me@myftpserver.com
    • password: pwd

    and it just works it out from there. I'm using this RIGHT THIS SECOND (trying to debug something) thru a squid proxy.

    ... but as you dont have an FTP proxy....

    Do you have a SOCKS proxy? That might work, but I dont know if .NET can do it. Otherwise, to be honest, I think you are stuck! FTP is an "odd" protocol, when compared to HTTP, as it has a control channel (port 21) and a data channel (or more than one, on a random port), so going via proxies is.... fun to say the least!

提交回复
热议问题