node-ftp icon indicating copy to clipboard operation
node-ftp copied to clipboard

how can i use ftp over system proxy

Open snadn opened this issue 9 years ago • 5 comments

the ftp connect to server look like DIRECT.and i need use it over a proxy.

snadn avatar Sep 07 '15 08:09 snadn

What kind of proxy?

mscdex avatar Sep 07 '15 16:09 mscdex

SOCKS

such as image

in fact, i use secureCRT and set the port forwarding to connect server for develop.

snadn avatar Sep 08 '15 01:09 snadn

There is no built-in support for proxies. It would be easy to support passing in a (connected) socket to use for the control connection instead of creating a new TCP connection, but the problem is with data connections.

I'm not sure of the best way to support proxying of data connections while keeping the interface generic enough to support other proxies besides SOCKS. Maybe have a data connection handler function as a connection option that takes in a callback with an (err, socket) signature so you can give a socket or at least a socket-like stream to the ftp module? I dunno...

mscdex avatar Sep 08 '15 01:09 mscdex

ok,thanks. i just try to find a way to let my develop can be esay.

Ftp I do not know much related technologies. But I'm curious how secureFX to deal with this problem.

image

snadn avatar Sep 08 '15 01:09 snadn

Hello, is there any solution to use http proxy? I have problem with connection. It is working on another sftp where I am using ssh2-sftp-client package. But for ftp it is not working.

for sftp I am just passing sock: socket as NodeJS.ReadableStream

socket.connect(this.config.proxyPort, this.config.proxyHost, () =>
            {
                socket.write(`CONNECT ${this.config.host}:${this.config.port}  HTTP/1.0\r\n\r\n`);
...

vavdav avatar Apr 04 '18 09:04 vavdav