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 | ||
.gitignore | ||
composer.json | ||
LICENSE | ||
README.md |
Titan II
Gemini Protocol library for PHP 8
Install
composer require yggverse/titan-ii
openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem -days 3650 -nodes -subj "/CN=IP"
php server.php
gemini://[IP]
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();