NAME

Net::Gemini::Server - test gemini server

SYNOPSIS

use Net::Gemini::Server;
my $server = Net::Gemini::Server->new(
  listen => {
    LocalAddr => '127.0.0.1',
    LocalPort => 0,
  },
  context => {
    SSL_cert_file => ...,
    SSL_key_file  => ...,
  }
);
$server->withforks(
  sub {
      my ( $client, $size, $request) = @_;
      ...
      close $client;
  }
);

DESCRIPTION

This module provides a simple test server for Net::Gemini; see the test code for that module.

METHODS

new param

Constructor. The param should include listen and context key values to configure the listen object and SSL context object.

context =item port =item socket

Accessors; return the context object (see IO::Socket::SSL), listen port, and socket of the server.

withforks callback

Accepts connections and forks child processes to handle the client request with the given callback. The callback is passed the client socket, size of the request, and the request string.

BUGS

None known. But it is a rather incomplete module; that may be considered a bug?

SEE ALSO

gemini://gemini.circumlunar.space/docs/specification.gmi (v0.16.1)

RFC 3986

COPYRIGHT AND LICENSE

Copyright 2022 Jeremy Mates

This program is distributed under the (Revised) BSD License: https://opensource.org/licenses/BSD-3-Clause