sergi / jsftp

Light and complete FTP client implementation for Node.js
MIT License
808 stars 155 forks source link

ECONNREFUSED Error #20

Closed ibjhb closed 12 years ago

ibjhb commented 12 years ago

I am having a problem when I am trying to PUT a file to Akamai's FTP. When I run it from my Mac OSX, everything works as expected. When I run it from Ubuntu or Linux Mint, I receive a ECONNREFUSED. I even tried an Ubuntu instance in Amazon to make sure it wasn't something on my network.

I've tried everything and am out of options. Any ideas? Can I get you more information to help debug this issue?

Thank you in advanced.

ibjhb commented 12 years ago

I just tried the latest Debian and it is also having the same problem.

drudge commented 12 years ago

Same on Ubuntu or Mac when using ftp.get

sergi commented 12 years ago

Lots and lots of changes and improvements went in since this issue was opened, the problem you are having could be fixed now. Can you try?

In the meantime, I will install a VM with Ubuntu and see if I can reproduce.

Thanks!

kartikrao commented 11 years ago

This is because jsftp ignores the host portion of the PASV response text in getPasvSocket.

Instead it uses self.host which is the host originally connected to.

If the host IP returned by PASV is different from the host originally connected to, then an ECONNREFUSED is raised when establishing the connection, this is common is CDN's such as Akamai or Edgecast.

The fix is to make getPasvSocket to parse both host and port from the PASV command response test, for example -

if res.text is [a,b,c,d,e,f,g] host is a.b.c.d port is 256 * f + g

Cheers

sergi commented 11 years ago

@kartikrao is right. It should be solved now (in 0.5.6)

Cheers.