【发布时间】:2019-06-28 13:54:39
【问题描述】:
我正在尝试使用 Docker 映像中的 vsftpd server 为 Alpakka FTP-Source 连接器重新创建 traversal example,但似乎无法连接。任何如何调整代码的指针都非常受欢迎:
FtpSettings ftpSettings = FtpSettings
.create(InetAddress.getLocalhost())
.withPort(21)
.withCredentials(FtpCredentials.NonAnonFtpCredentials.create("news", "test"))
.withBinary(true)
.withPassiveMode(true)
.withConfigureConnectionConsumer(
(FTPClient ftpClient) -> {
ftpClient.addProtocolCommandListener(
new PrintCommandListener(new PrintWriter(System.out), true));
});
Source<FtpFile, NotUsed> ftp = Ftp.ls("/", ftpSettings);
ftp.to(Sink.foreach(s -> LOGGER.info(s.name())));
仅供参考:登录信息有效,例如使用 filezilla。
【问题讨论】:
-
原来使用
PASV_ADDRESS=foo的容器设置是问题所在。为什么 Filezilla 能够解决它,但我无法理解。