Gemini Protocol library for PHP 8
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ghost 050b444e92 fix namespace 10 months ago
src fix namespace 10 months ago
.gitignore ignore tmp 4 years ago
LICENSE Add License 3 years ago
README.md fix namespace 10 months ago
composer.json fix namespace 10 months ago

README.md

Titan II

Gemini Protocol library for PHP 8

Install

  1. composer require yggverse/titan-ii
  2. openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem -days 3650 -nodes -subj "/CN=127.0.0.1"
  3. php server.php
  4. gemini://127.0.0.1

Usage

<?php

$server = new \Yggverse\TitanII\Server();

$server->setCert('cert.pem');
$server->setKey('key.rsa');

$server->setHandler(
    function (\Yggverse\TitanII\Request $request): \Yggverse\TitanII\Response
    {
        $response = new \Yggverse\TitanII\Response();

        $response->setCode(20);
        $response->setMeta('text/plain');
        $response->setContent('Hello World!');

        return $response;
    }
);

$server->start();