Gemini Protocol library for PHP 8
Go to file
Tanner Mckenney f8015cadda Small bug
2021-02-09 20:47:40 -08:00
src Small bug 2021-02-09 20:47:40 -08:00
test Documentation 2021-02-09 19:08:54 -08:00
.gitignore ignore tmp 2021-02-09 19:33:59 -08:00
composer.json Update version 2021-02-09 20:42:33 -08:00
composer.lock Update lock file 2021-02-09 20:43:21 -08:00
README.md Add Links to Readme 2021-02-09 19:12:47 -08:00

Titan II

Gemini Protocol library for PHP.

Basic Implentation

<?php

use TitanII\Request;
use TitanII\Response;
use TitanII\Server;

$server = new Server();

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

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

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

    return $response;
});

$server->start();

Instructions

  1. run cd test/certs; openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem -days 3650 -nodes -subj "/CN=127.0.0.1"
  2. run composer install
  3. run cd ..; php server.php
  4. Open gemini://127.0.0.1