mirror of
https://github.com/YGGverse/titan-II.git
synced 2025-01-11 23:58:29 +00:00
Gemini Protocol library for PHP 8
src | ||
test | ||
.gitignore | ||
composer.json | ||
composer.lock | ||
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
- 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"
- run
composer install
- run
cd ..; php server.php
- Open
gemini://127.0.0.1