FluentFTP: Uploading error when connecting through SOCKS4 / SOCKS4a / SOCKS5 proxy

FTP OS: Windows

FTP Server: Reproduced on XLight and EFT

Computer OS: Windows

FluentFTP Version: 38.0.0

Every time I upload 8 megs or (bigger) file through SOCKS4, SOCKS4a or even SOCKS5 (which exists in the library for the long time) it is uploaded incomplete and with different file size each time. When I upload without proxy, everything is OK.

Logs :



# Connect()
Status:   Connecting to ***:1080
Response: 220 Xlight FTP Server 3.8 ready...
Status:   Detected FTP server: XLight
Command:  USER ***
Response: 331 Password required for nuser
Command:  PASS ***
Response: 230 Login OK
Command:  FEAT
Response: 211-Features supported
Response: REST STREAM
Response: EPRT
Response: EPSV
Response: SIZE
Response: MDTM
Response: MFMT
Response: AUTH
Response: PBSZ
Response: PROT
Response: MLST type*;size*;modify*;
Response: MLSD
Response: 211 End
Status:   Text encoding: System.Text.ASCIIEncoding
Command:  SYST
Response: 215 UNIX Type: L8
Status:   Listing parser set to: Machine

# Upload("test.mdf", Overwrite, False)

# FileExists("test.mdf")
Command:  PWD
Response: 257 "/"
Command:  SIZE /test.mdf
Response: 213 7954432

# DeleteFile("test.mdf")
Command:  DELE test.mdf
Response: 250 Deleted file "test.mdf".

# OpenWrite("test.mdf", Binary)

# GetFileSize("test.mdf")
Command:  SIZE test.mdf
Response: 550 Can't find file "test.mdf".
Command:  TYPE I
Response: 200 Type set to I.

# OpenPassiveDataStream(AutoPassive, "STOR test.mdf", 0)
Command:  EPSV
Response: 229 Entering Passive Mode (|||50030|)
Status:   Connecting to ***:1080
Command:  STOR test.mdf
Response: 150 Opening BINARY mode data connection for test.mdf.
Status:   Disposing FtpSocketStream...
Response: 226 Transfer complete (26707.252 KB/s).
Command:  QUIT
Response: 221 Good-Bye
Status:   Disposing FtpSocketStream...


About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

I was referring to @fire-lizard - fighting for his country in the Ukraine. Trouble is, I don’t have any access to proxies for testing.

Ok. I understand.

I just now realized the connection to the PROXY! There is always a 6 byte header to be removed… somewhere there must still be a bug in the “dissection” of stuff that is received from the proxy. That needs to be debugged (it is problem #1, funny name being received with 6 zeros in front???, the number “six” is definitely a big clue to the problem and looks very fishy).

problem #2 would then be: Uploaded looks good, means we sent all the data, but actual size on the server is much smaller.

Could be, 6 bytes are being “swallowed” on each transfer chunk sent? Could that be? Chunks would be maybe MSS like 1400 bytes, then 6 bytes would be about 0.5% bytes missing?

@robinrodricks says you wrote the proxy stuff, can you think about it too?

We are having electricity problems in Ukraine from time to time

Take your time. I am on your side.