-- Leo's gemini proxy

-- Connecting to yggverse.cities.yesterweb.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

nps-php 1.1.0


Server API changed with new features


Constructor receive line and size arguments, where the class contain new setters:


Server::setLine

Server::setSize


Handler function return success status as the new argument


Example


$server = new \Yggverse\Nps\Server;

$server->start(
    function (
          bool $success,
        string $content,
        string $request,
        string $connect
    ) {
        printf(
            'connection: %s request: %s',
            $connect,
            $request
        );

        if ($success)
        {
            var_dump(
                $content
            );
        }
    }
);

Links


Download nps-php 1.1.0

-- Response ended

-- Page fetched on Mon Jun 3 14:50:15 2024