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.
Tanner Mckenney 3f0594960e Nullable returns + tokenize 4 years ago
src Nullable returns + tokenize 4 years ago
test Documentation 4 years ago
.gitignore ignore tmp 4 years ago
README.md Add Links to Readme 4 years ago
composer.json Update version 4 years ago
composer.lock Update lock file 4 years ago

README.md

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