A FTP server framework written by Golang
Go to file
Lunny Xiao 58ae51ec01
All checks were successful
checks / check and test (push) Successful in 1m45s
use Gitea actions instead of drone (#165)
Reviewed-on: #165
2023-06-02 16:00:04 +00:00
.gitea/workflows use Gitea actions instead of drone (#165) 2023-06-02 16:00:04 +00:00
driver Support offset (#139) 2020-12-04 20:55:17 +08:00
example Support rate limit (#145) 2020-12-06 21:07:38 +08:00
integrations Rename ServerOpts to Options and add an example (#142) 2020-12-06 18:15:34 +08:00
ratelimit Support rate limit (#145) 2020-12-06 21:07:38 +08:00
.gitignore Factor into server and driver directories (#120) 2020-07-07 16:02:27 +00:00
auth.go Branch v2 2020-12-01 20:39:33 +08:00
cmd_test.go Branch v2 2020-12-01 20:39:33 +08:00
cmd.go Add data for context (#158) 2021-09-02 13:06:28 +08:00
context.go Add data for context (#158) 2021-09-02 13:06:28 +08:00
data_socket.go Support rate limit (#145) 2020-12-06 21:07:38 +08:00
doc.go Branch v2 2020-12-01 20:39:33 +08:00
driver.go Rename ServerOpts to Options and add an example (#142) 2020-12-06 18:15:34 +08:00
file_info.go Branch v2 2020-12-01 20:39:33 +08:00
go.mod Branch v2 2020-12-01 20:39:33 +08:00
go.sum Fix bug when not use ListenAndServe (#110) 2020-04-18 05:10:37 +00:00
LICENSE release v0.3.0 2018-04-20 20:40:37 +08:00
list_formatter.go Bugfix: listing result modify time error when file older than one year (#150) 2021-06-16 09:36:36 +08:00
logger.go optimization on stack trace and fix wrong words (#154) 2021-07-04 19:15:47 +08:00
notifier.go Branch v2 2020-12-01 20:39:33 +08:00
perm.go Branch v2 2020-12-01 20:39:33 +08:00
README.md use Gitea actions instead of drone (#165) 2023-06-02 16:00:04 +00:00
server.go Fix missed commands when given commands (#159) 2021-09-02 13:45:31 +08:00
session_test.go Rename ServerOpts to Options and add an example (#142) 2020-12-06 18:15:34 +08:00
session.go Expose more methods (#157) 2021-09-02 12:37:56 +08:00

server

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

Full documentation for the package is available on godoc

Installation

go get goftp.io/server/v2

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/ftpd

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.

Contact us

You can contact us via discord https://discord.gg/ytmYqfNfqh or QQ群 972357369

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.