简体   繁体   English

Node.js - 通过 HTTP 隧道的 FTP(FTP over HTTP 代理)

[英]Node.js - FTP through HTTP Tunnel (FTP over HTTP Proxy)

I am looking for an opportunity to connect FTP-Server via HTTP-Proxy-Server.我正在寻找通过 HTTP-Proxy-Server 连接 FTP-Server 的机会。 I tried different npm packages (jsftp, ftp etc.), but the connection does not work.我尝试了不同的 npm 包(jsftp、ftp 等),但连接不起作用。 I have tried a few SOCKS packages but they seem outdated.我尝试了一些 SOCKS 软件包,但它们似乎已经过时。 Here is an example from the package jsftp.这是 jsftp 包中的一个示例。 Unfortunately, the example does not work and I can not find any solution不幸的是,该示例不起作用,我找不到任何解决方案

const {SocksClient} = require('socks');
const ftp = new Ffp({
  host: 'localhost',
  port: 3333,
  user: 'user',
  pass: 'password',
  createSocket: ({port, host}, firstAction) => {
    return SocksClient.createConnection({
      proxy: {
        ipaddress: '159.203.75.200'
        port: 1080,
        type: 5
      },

      command: 'connect',

      destination: {
        host,
        port
      }
    })
  }
})

This solution worked for me.这个解决方案对我有用。 However, it uses platform-dependent packages and is only commercially available starting from USD 289.但是,它使用依赖于平台的软件包,并且仅从 289 美元起在商业上可用。

This solution looked promising, but I couldn't get it to work properly. 这个解决方案看起来很有希望,但我无法让它正常工作。 It created files I wanted to copy, but they always ended up being empty.它创建了我想复制的文件,但它们最终总是空的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM