Comments (6)
I just tested it and it seems to work fine:
Can you give more details ?
from ftpserverlib.
filezilla version: 3.31.0
macOS version: 10.13.3
compile and run param is default
Terminal logs:
level=debug ts=2018-03-10T01:24:26.392273Z caller=sample_driver.go:77 component=driver msg="Fetching our external IP address..."
level=debug ts=2018-03-10T01:24:26.98076Z caller=sample_driver.go:81 component=driver msg="Fetched our external IP address" ipAddress=36.149.204.189
level=info ts=2018-03-10T01:24:26.981025Z caller=server.go:132 component=server msg=Listening... action=ftp.listening address=[::]:2121
level=info ts=2018-03-10T01:24:26.981103Z caller=server.go:158 component=server msg=Starting... action=ftp.starting
level=info ts=2018-03-10T01:24:32.611071Z caller=server.go:198 component=server clientId=1 msg="FTP Client connected" action=ftp.connected clientIp=127.0.0.1:53236
level=debug ts=2018-03-10T01:24:32.611127Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="220 Welcome on ftpserver, you're on dir /var/folders/rn/jqhb880175ng7mv28ld55fcw0000gn/T/ftpserver087115208, your ID is 1, your IP:port is 127.0.0.1:53236, we currently have 1 clients connected"
level=debug ts=2018-03-10T01:24:32.611253Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="AUTH TLS\r\n"
level=info ts=2018-03-10T01:24:32.61128Z caller=sample_driver.go:96 component=driver msg="Loading certificate"
level=info ts=2018-03-10T01:24:32.611293Z caller=sample_driver.go:113 component=driver msg="Creating certificate"
level=debug ts=2018-03-10T01:24:32.770226Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="234 AUTH command ok. Expecting TLS Negotiation."
level=debug ts=2018-03-10T01:24:34.002522Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="USER test\r\n"
level=debug ts=2018-03-10T01:24:34.00258Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="331 OK"
level=debug ts=2018-03-10T01:24:34.002843Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="PASS test\r\n"
level=debug ts=2018-03-10T01:24:34.00303Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="230 Password ok, continue"
level=debug ts=2018-03-10T01:24:34.003187Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="OPTS UTF8 ON\r\n"
level=debug ts=2018-03-10T01:24:34.003217Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="200 I'm in UTF8 only anyway"
level=debug ts=2018-03-10T01:24:34.003349Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="PBSZ 0\r\n"
level=debug ts=2018-03-10T01:24:34.017579Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="200 Whatever"
level=debug ts=2018-03-10T01:24:34.017794Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="PROT P\r\n"
level=debug ts=2018-03-10T01:24:34.01782Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="200 OK"
level=debug ts=2018-03-10T01:24:34.026368Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="PWD\r\n"
level=debug ts=2018-03-10T01:24:34.026428Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="257 \"/\" is the current directory"
level=debug ts=2018-03-10T01:24:34.027145Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="TYPE I\r\n"
level=debug ts=2018-03-10T01:24:34.062415Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="200 Type set to binary"
level=debug ts=2018-03-10T01:24:34.062609Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="PASV\r\n"
level=debug ts=2018-03-10T01:24:34.062702Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="227 Entering Passive Mode (36,149,204,189,8,97)"
level=debug ts=2018-03-10T01:24:34.063016Z caller=client_handler.go:159 component=server clientId=1 msg="FTP RECV" action=ftp.cmd_recv line="MLSD\r\n"
level=debug ts=2018-03-10T01:24:34.06313Z caller=client_handler.go:194 component=server clientId=1 msg="FTP SEND" action=ftp.cmd_send line="150 Using transfer connection"
level=info ts=2018-03-10T01:24:54.147999Z caller=server.go:198 component=server clientId=2 msg="FTP Client connected" action=ftp.connected clientIp=127.0.0.1:53244
level=debug ts=2018-03-10T01:24:54.148066Z caller=client_handler.go:194 component=server clientId=2 msg="FTP SEND" action=ftp.cmd_send line="220 Welcome on ftpserver, you're on dir /var/folders/rn/jqhb880175ng7mv28ld55fcw0000gn/T/ftpserver087115208, your ID is 2, your IP:port is 127.0.0.1:53244, we currently have 2 clients connected"
level=debug ts=2018-03-10T01:24:54.148186Z caller=client_handler.go:159 component=server clientId=2 msg="FTP RECV" action=ftp.cmd_recv line="AUTH TLS\r\n"
level=debug ts=2018-03-10T01:24:54.148209Z caller=client_handler.go:194 component=server clientId=2 msg="FTP SEND" action=ftp.cmd_send line="234 AUTH command ok. Expecting TLS Negotiation."
In filezilla GUI:
It is blocked in reading dir list, then timeout and retry.
from ftpserverlib.
@fclairamb In sample_driver there is no handler for /virtual/file2.txt, so sample server tries to find it in BaseDir (temporary-folder/shared). Does not find it there and returns an error, which is observed @nifflerfox
from ftpserverlib.
After that it seems to behave like this when the directory is empty.
func (driver *ClientDriver) ListFiles(cc server.ClientContext) ([]os.FileInfo, error) {
path := driver.BaseDir + cc.Path()
files, err := ioutil.ReadDir(path)
if err != nil {
return nil, err
}
files = append(files, virtualFileInfo{
name: ".",
mode: os.FileMode(0666) | os.ModeDir,
size: 4096,
})
return files, err
}
You can suppress it if there is a current directory object like this
from ftpserverlib.
@nifflerfox you use "127.0.0.1", but @fclairamb use "localhost"
i have same error, change to "localhost" is ok!
please fix this bug, @fclairamb
from ftpserverlib.
I don't think we can consider it as a bug, but we can still fix it.
Not a bug
Explanation
When you connect to localhost
, on all modern systems you're in IPv6 and FileZilla opens the passive connection with the ESPV
command, the server replies only with a port (the target host stays the same).
When you connect to 127.0.0.1
, you're on IPv4 and FileZilla opens the passive connection with the PASV
command, the server replies with an IP and port. But in our case, the replied IP is the external one.
Examples
localhost --> ESPV
action=ftp.cmd_recv line="EPSV\r\n"
action=ftp.cmd_send line="229 Entering Extended Passive Mode (|||2145|)"
127.0.0.1 --> PASV
action=ftp.cmd_recv line="PASV\r\n"
action=ftp.cmd_send line="227 Entering Passive Mode (176,175,130,7,8,97)"
Still... Not cool
As it breaks the tests people are performing on the server.
The fix
With #53, we have the ability to declare a dynamic IP resolver to change the target IP address depending on the client. So what we can do is that all the loopback clients can have a loopback server address.
So I'll create a fix for that.
from ftpserverlib.
Related Issues (20)
- do not quit serve loop on temporary accept errors? HOT 1
- Add some badges HOT 1
- Action Required: Fix Renovate Configuration
- Allow users to extend/change handlers HOT 2
- Fix gocover.io HOT 1
- Configurable FTP client authentication method HOT 2
- PASV command crash
- FR: customize error codes HOT 6
- LIST command doesn't work for file HOT 1
- Dependency Dashboard
- Add support for wildcards in LIST HOT 2
- Restore IPv6 support HOT 1
- MLSD Response: 550 Could not list: Not supported HOT 1
- MLST gives incorrect response HOT 6
- Unable to catch abort transfer from client HOT 1
- protocol not available, Unable to open transfer HOT 3
- Could not list the contents of the bucket , throws 550 error (afero-s3) HOT 1
- APPE should create a file if it does not yet exist
- Unable to use IPv6 HOT 3
- Transmit / LibNcFTP 3.2.3 stop working after issuing the FEAT command. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ftpserverlib.