A FTP server framework written by Golang
Go to file
Denis Girko 837edced7e Introduced User object which can keep arbitrary user context 2019-10-17 23:44:57 +03:00
exampleftpd update projects new package name 2019-07-12 17:18:27 +08:00
.drone.yml add drone support (#74) 2019-07-12 10:10:02 +08:00
.gitignore update projects new package name 2019-07-12 17:18:27 +08:00
auth.go Introduced User object which can keep arbitrary user context 2019-10-17 23:44:57 +03:00
cmd_test.go release v0.3.0 2018-04-20 20:40:37 +08:00
cmd.go Introduced User object which can keep arbitrary user context 2019-10-17 23:44:57 +03:00
conn_test.go Fix for passiveListenIP. Currently the function returns different (#70) 2019-07-12 12:48:12 +08:00
conn.go Introduced User object which can keep arbitrary user context 2019-10-17 23:44:57 +03:00
doc.go release v0.3.0 2018-04-20 20:40:37 +08:00
driver.go release v0.3.0 2018-04-20 20:40:37 +08:00
fileinfo.go release v0.3.0 2018-04-20 20:40:37 +08:00
go.mod remove unused go sum 2019-08-12 13:27:25 +08:00
go.sum remove unused go sum 2019-08-12 13:27:25 +08:00
LICENSE release v0.3.0 2018-04-20 20:40:37 +08:00
listformatter.go 🐛 Fixes the problem of integer overflow when file size is too large (#43) 2018-05-02 13:34:58 +08:00
logger.go Improve shutdown behaviour (#42) 2018-04-25 09:05:38 +08:00
perm.go release v0.3.0 2018-04-20 20:40:37 +08:00
README.md update projects new package name 2019-07-12 17:18:27 +08:00
server_test.go update projects new package name 2019-07-12 17:18:27 +08:00
server.go fix feats command bug (#53) 2018-09-09 11:04:33 +08:00
socket.go Fix socket leak for never used PASV connections (#62) 2019-01-11 22:28:36 +08:00

server

Build Status

A FTP server framework forked from github.com/yob/graval and changed a lot.

Full documentation for the package is available on godoc

Version

v0.2.3

Installation

go get goftp.io/server

Usage

To boot a FTP server you will need to provide a driver that speaks to your persistence layer - the required driver contract is in the documentation.

Look at the file driver to see an example of how to build a backend.

There is a sample ftp server as a demo. You can build it with this command:

go install goftp.io/server/exampleftpd

Then run it if you have add $GOPATH to your $PATH:

exampleftpd -root /tmp

And finally, connect to the server with any FTP client and the following details:

host: 127.0.0.1
port: 2121
username: admin
password: 123456

This uses the file driver mentioned above to serve files.

Contributors

see https://gitea.com/goftp/server/graphs/contributors

Warning

FTP is an incredibly insecure protocol. Be careful about forcing users to authenticate with an username or password that are important.

License

This library is distributed under the terms of the MIT License. See the included file for more detail.

Contributing

All suggestions and patches welcome, preferably via a git repository I can pull from. If this library proves useful to you, please let me know.

Further Reading

There are a range of RFCs that together specify the FTP protocol. In chronological order, the more useful ones are:

For an english summary that's somewhat more legible than the RFCs, and provides some commentary on what features are actually useful or relevant 24 years after RFC959 was published:

For a history lesson, check out Appendix III of RCF959. It lists the preceding (obsolete) RFC documents that relate to file transfers, including the ye old RFC114 from 1971, "A File Transfer Protocol"

This library is heavily based on em-ftpd, an FTPd framework with similar design goals within the ruby and EventMachine ecosystems. It worked well enough, but you know, callbacks and event loops make me something something.