首页 > 解决方案 > FTPS 服务器给出错误:超时(控制套接字)

问题描述

我正在尝试使用节点 js 连接到 ftps 服务器。我正在使用“ https://www.npmjs.com/package/basic-ftp ”模块。但它给了我以下错误。我尝试了许多模块,但发生了同样的错误。请帮帮我

index.js

    const ftp = require("basic-ftp")

    example();

    async function example() {
     const client = new ftp.Client()
        client.ftp.verbose = true;
        try {
        const secureOptions = {
             rejectUnauthorized: false,
              host: "xxx.xxx.com",
              port:990

                };

         await client.access({
                host: "xxx.xxx.com",
                port:990,
                user: "xxxx@xxxx.xxx",
                secure:true, 
                password: "xxxxxx",
                secureOptions : secureOptions


            });

    }
    catch(err) {
            console.log(err)
        }
    }


Error: Timeout (control socket)
    at Socket.socket.once (D:\node\basicftp\node_modules\basic-ftp\dist\FtpConte
xt.js:310:58)
    at Object.onceWrapper (events.js:286:20)
    at Socket.emit (events.js:198:13)
    at Socket._onTimeout (net.js:442:8)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

标签: javascriptnode.jsftpsftp-server

解决方案


推荐阅读