Shadowsocks-android: Not able to access ftp site on 5.1.x

Created on 11 Dec 2020  ·  8Comments  ·  Source: shadowsocks/shadowsocks-android

Install 5.1.6 on Android 10, enable a profile. Access site: ftp://ftp.fedex.com/pub/us/software/

Not able to open this site. However it works on version 5.0.6.
Check server access log, even no log for that site.

bug

Most helpful comment

FTP is a very old protocol. Imaging a telnet session in the late 90s,

  1. You establish a TCP connection to a server port,
  2. The server first send a prompt to ask for your login info,
  3. You follow the prompt to send username and password.
  4. The server will tell you if the login is successful or not.

And it's similar for FTP, here is a diagram I found: https://www.eventhelix.com/RealtimeMantra/Networking/FTP.pdf

Generally, if a TCP protocol requires the server to send the prompt first, it cannot work with the current shadowsocks-rust.

All 8 comments

It looks an issue of shadowsocks-rust. I cannot get my FTP client working with the shadowsocks-rust locally.

@zonyitoo To get FTP works, we need to establish the TCP relay even there's no request sent from client. Can you double check this?

@zonyitoo here is a similar fix for shadowsocks-libev before: https://github.com/shadowsocks/shadowsocks-libev/commit/fa82628dd938ee5285cbce481cc722539d8ade2a

When a new socks5 client connected, after a small duration, we would establish a TCP relay to the remote shadowsocks server even if there's no data sent from the client.

@zonyitoo To get FTP works, we need to establish the TCP relay even there's no request sent from client. Can you double check this?

I understand. But why? Why FTP requires proxy server to connect to remote without any data was sent?

FTP is a very old protocol. Imaging a telnet session in the late 90s,

  1. You establish a TCP connection to a server port,
  2. The server first send a prompt to ask for your login info,
  3. You follow the prompt to send username and password.
  4. The server will tell you if the login is successful or not.

And it's similar for FTP, here is a diagram I found: https://www.eventhelix.com/RealtimeMantra/Networking/FTP.pdf

Generally, if a TCP protocol requires the server to send the prompt first, it cannot work with the current shadowsocks-rust.

Got it.

This is fixed? Should we close it?

Nope, I think we have to wait until the next release of shadowsocks-rust.

I have already fixed in feature-separate-crates branch. But I haven't finished migrating dns-relay, yet.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Edelwiess picture Edelwiess  ·  6Comments

libook picture libook  ·  4Comments

ggwolfking picture ggwolfking  ·  3Comments

tamashii picture tamashii  ·  5Comments

CzBiX picture CzBiX  ·  3Comments