mirror of https://github.com/YGGverse/titan-II.git
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
7ee0008999
|
10 months ago | |
---|---|---|
src | 10 months ago | |
.gitignore | 4 years ago | |
LICENSE | 3 years ago | |
README.md | 10 months ago | |
composer.json | 10 months ago |
README.md
Titan II
Gemini Protocol library for PHP 8
- gemini://gemini.circumlunar.space/
- https://gemini.circumlunar.space/
Install
composer require yggverse/titan-ii
openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem -days 3650 -nodes -subj "/CN=127.0.0.1"
php server.php
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();