NET-SERVER(1)
π¦ NET-SERVER(1) π¦
okay so bestie, buckle up β this is the manual page for net-server, straight out of the User Contributed Perl Documentation collection, and honestly? it's giving "tiny tool, big energy." π
β¨ NAME β¨
net-server β the base Net::Server starting module. that's it, that's the whole name section. iconic of it. π
πΈ SYNOPSIS πΈ
here's the shape of the thing, copied exactly because duh:
net-server [base type] [net server arguments]
net-server PreFork ipv '*'
net-server HTTP
net-server HTTP app foo.cgi
net-server HTTP app foo.cgi app /=bar.cgi
net-server HTTP port 8080 port 8443/ssl ipv '*' server_type PreFork --SSL_key_file=my.key --SSL_cert_file=my.crt access_log_file STDERR
like, look at that last one. it's a whole mood. π₯
π DESCRIPTION π
so the net-server program is literally just a super simple way to test out code and try out port connection parameters. that's its whole job and it does it well.
now, ngl, the running server can be robust enough for production β no cap β but the expectation is that this binary is gonna be used for:
- basic testing of
net-serverports - acting as a simple echo server
- running development scripts as CGI
lowkey humble, highkey useful. π«Ά
π OPTIONS π
π base type
the very first argument can be a Net::Server flavor. this is basically shorthand so you don't have to write out server_type "ServerFlavor" yourself β we love a shortcut.
plus, this trick lets types like HTTP and PSGI β which are not true Net::Server base types β subclass other server types by passing an extra server_type argument. sneaky? a little. slay? absolutely.
net-server PreFork
net-server HTTP # becomes a HTTP server in the Fork flavor
net-server HTTP server_type PreFork # preforking HTTP server
π port
the port to bind upon. and here's where the defaults get kinda specific, so listen up:
- default is
80if you're running a HTTP server as root - default is
8080if you're running a HTTP server as non-root - default is
20203otherwise
you can give multiple values to bind to multiple ports, which is honestly so extra in the best way. and every single method for specifying port attributes that's enumerated in Net::Server and Net::Server::Proto? all available here. all of them. π
net-server port 20201
net-server port 20202
net-server port 20203/IPv6
π host
the host to bind to. default is *.
here's the vibe check on how it picks a socket:
- give it an IPv4 address β it binds to an IPv4 socket
- give it an IPv6 address β it binds to an IPv6 socket (this one requires installation of
IO::Socket::INET6, fyi) - give it a hostname and
ipvis still set to4β IPv4 socket gets created - give it a hostname and
ipvis set to6β IPv6 socket gets created - give it a hostname and
ipvis set to*(the default) β a lookup happens and any available IPv4 or IPv6 addresses get bound
and the ipv parameter can be set directly, or passed along in the port, or passed as part of the hostname. three whole ways. choose your fighter. π
net-server host localhost
net-server host localhost/IPv4
β bestie, there are many more options available. please see the Net::Server documentation β this page is not the whole story, it's like the trailer. π§
π AUTHOR π
Paul Seamons <paul@seamons.com> β we stan. π
π LICENSE π
this package may be distributed under the terms of either of these two:
- GNU General Public License
- or the Perl Artistic License
pick your poison, both are valid. π¦
and that's a wrap, bestie π this page was brought to you by perl v5.42.0, dated 2023-03-15 β go forth and bind some ports, fr fr πΈ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Net-Server 2.014-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms