class Ftp::FTPServer
- Ftp::FTPServer
- Reference
- Object
Overview
Example of utilisation
include Ftp
server = FTPServer.new(8000, ".")
server.start
sleep
This will launch a FTP server, listening for clients at port 8000, rooted in the current directory
Defined in:
ftp.crcommands.cr
Constant Summary
-
ANONYMOUS =
"anonymous" -
Downcased anonymous username (meaning connecting with it will start an anonymous session)
-
PASSWORD =
"password" -
Default password for new users
Constructors
Instance Method Summary
-
#bind
Starting the FTP server, making clients able to connect and communicate with it
-
#port : Int32
Port on which the server listen
-
#root : String
Path on which the server is mounted
-
#start
Starting the FTP server, making clients able to connect and communicate with it
-
#verbose_level=(level : Logger::Severity)
Change the level of severity beyond which the logger of your
FTPServerwill print logs
Macro Summary
Constructor Detail
Create a FTP server, configurate to listen to #port, and mounted on #root
my_ftp_server = Ftp::FTPServer.new(port: 8000, root: "/home")
NOTE : The returned FTP server is not listening for clients : it needs to be started, with #start
Instance Method Detail
Starting the FTP server, making clients able to connect and communicate with it
NOTE The exection is launched in a fiber, so the rest of your program is not blocked
my_ftp_server.start
# From now, the server is accepting clients and handling them properly
sleep # Yield the executionChange the level of severity beyond which the logger of your FTPServer will print logs
NOTE When building in release mode, the severity is by default at Logger::ERROR. Otherwise, it is set by default at Logger::INFO