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.

45 lines
1.2 KiB

4 years ago
# Titan II
Composer / PHP 8 library for [Gemini Protocol](https://geminiprotocol.net)
4 years ago
Simply create online server with native IPv6 support for PHP apps or just static `gemtext`
## Integrations
* [β-Doku](https://github.com/YGGverse/bdoku) - DokuWiki Satellite for Gemini Protocol
7 months ago
* [Pulsar](https://github.com/YGGverse/Pulsar) - RSS Aggregator with build-in Titan-II server
7 months ago
* [KVAZAR](https://github.com/kvazar-network/geminiapp) - KevaCoin Content Explorer
* [KevaChat](https://github.com/kevachat/geminiapp) - Chat in KevaCoin BlockChain
## Install
1. `composer require yggverse/titan-ii`
10 months ago
2. `openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem -days 1 -nodes -subj "/CN=IP"`
3. `php server.php`
10 months ago
4. `gemini://[IP]`
## Usage
4 years ago
``` php
4 years ago
<?php
10 months ago
$server = new \Yggverse\TitanII\Server();
4 years ago
$server->setCert('cert.pem');
$server->setKey('key.rsa');
$server->setHandler(
10 months ago
function (\Yggverse\TitanII\Request $request): \Yggverse\TitanII\Response
{
10 months ago
$response = new \Yggverse\TitanII\Response();
4 years ago
$response->setCode(20);
$response->setMeta('text/plain');
$response->setContent('Hello World!');
4 years ago
return $response;
}
);
4 years ago
10 months ago
$server->start('IP', 1965);
```