AnyEve...:Server(3pm)

πŸ“¦ version 0.20, in ubuntu stonking

πŸ’– AnyEvent::FTP::Server πŸ’–

bestie. come sit with me. today we're talking about AnyEvent::FTP::Server β€” the Simple asynchronous ftp server from the AnyEvent::FTP family, chill and async-coded like it's got main character energy. version 0.20, periodt. ✨


πŸŽ€ SYNOPSIS πŸŽ€

okay so the absolute vibe-minimum to get this baby running:

use AnyEvent;
use AnyEvent::FTP::Server;

my $server = AnyEvent::FTP::Server->new;
$server->start;
AnyEvent->condvar->recv;

like… that's it. she starts, she serves, she stays alive. πŸ’…


🌸 DESCRIPTION 🌸

CAUTION πŸ’€ AnyEvent::FTP::Server hasn't been audited by anyone, including its author, in order to ensure that it is secure. It is intended to be used primarily in testing the companion client AnyEvent::FTP::Client. It can also be used to write your own context or personality (to use the Net::FTPServer terminology) that use alternate back ends (say a database or memory store) that could theoretically be made to be secure, but you will need to carefully vett both the AnyEvent::FTP::Server code as well as your own customizations before you deploy on the Internet or on an untrusted network.

fr fr read that twice. nobody β€” not even the author β€” has audited this for security. 😭 it's a test buddy for AnyEvent::FTP::Client first and foremost. you can build your own context or personality (that's the Net::FTPServer vocabulary, iykyk) riding on alternate back ends like a database or an in-memory store, and theoretically those could be made secure, but you have to carefully vett both the AnyEvent::FTP::Server code and your own customizations before you put this anywhere near the Internet or an untrusted network. no cap. πŸ”₯

so what is this class? it's the thing you use for AnyEvent::FTP server instances. every single time a client connects, a AnyEvent::FTP::Server::Connection instance gets made to manage that TCP connection. and each connection also has a AnyEvent::FTP::Server::Context which defines the behavior / personality of the server β€” and each context instance is the one keeping track of the current directory, user authentication, and authorization status of each connected client. she's organized. she's tracked. she's iconic. πŸ‘‘


✨ ATTRIBUTES ✨

🌈 hostname

my $hostname = $server->hostname;

Readonly β€” assign it at the constructor. this is the hostname to listen on. πŸ¦‹

🌈 port

my $port = $server->port;

the port to listen to. default is 21, but you can hand her a different port at the constructor. πŸ’–

🌈 default_context

my $context = $server->default_context;

Readonly: the default context class (and yes, it can be set as a parameter in the constructor). πŸŽ€

🌈 welcome

my($code, $message) = @{ $server->welcome };

the welcome messages, as key value pairs. read only, and it can be overridden by the constructor. say hi cute. 🌸

🌈 bindport

my $port = $server->bindport;
$server->bindport($port);

retrieves or sets the TCP port to bind to. getter/setter behavior, we love a flexible queen. πŸ’…

🌈 inet

my $bool = $server->inet;

Readonly (but assignable via the constructor, bestie, don't worry). if it's true, then assume a TCP connection has been established by inet. the default (false) is to start a standalone server. 🫢


🧚 METHODS 🧚

⭐ start

$server->start;

call this method to start the service. that's literally it. she's up. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

  • Net::FTPServer

πŸ’œ AUTHOR πŸ’œ

Author: Graham Ollis <plicease@cpan.org>

Contributors:

  • Ryo Okamoto
  • Shlomi Fish
  • JosΓ© JoaquΓ­n Atria

This software is copyright (c) 2017-2022 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, bestie!! πŸŽ€ this was the AnyEve...:Server(3pm) page out of the User Contributed Perl Documentation set, sitting at perl v5.40.1, dated 2026-02-16 β€” go forth and serve (responsibly, on a trusted network, please πŸ™ˆπŸ’–).

πŸ“¦ where this page comes from