Browse Source

fix protocol name

main
yggverse 2 weeks ago
parent
commit
46d1cb55ef
  1. 16
      README.md
  2. 4
      config/example.json
  3. 4
      src/Controller/Server/Nex.php
  4. 8
      src/server.php

16
README.md

@ -6,9 +6,9 @@ RSS aggregator for different protocols @@ -6,9 +6,9 @@ RSS aggregator for different protocols
* [x] `src/crawler.php` - scan configured RSS feeds and dump results to SQLite ([alternative branch](https://github.com/YGGverse/Pulsar/tree/fs))
* [ ] `src/cleaner.php` - auto clean deprecated records
* [x] `src/server.php` - server launcher with multiple host support, based on [Ratchet](https://github.com/ratchetphp/Ratchet) asynchronous socket library
* [x] [NEX Protocol](https://nightfall.city/nps/info/specification.txt)
* [ ] [Gemini Protocol](https://geminiprotocol.net)
* [x] `src/server.php` - server launcher for different protocols:
* [x] [NEX](https://nightfall.city/nex/info/specification.txt) - based on [Ratchet](https://github.com/ratchetphp/Ratchet) `IoServer` asynchronous socket library
* [ ] [Gemini](https://geminiprotocol.net)
## Example
@ -29,7 +29,9 @@ RSS aggregator for different protocols @@ -29,7 +29,9 @@ RSS aggregator for different protocols
## Server
* `php src/server.php protocol=NPS config=name.json` - launch `NPS` server configured by `name.json`
* `protocol` - supported options:
* `NPS`
* `config` - relative (to `config` folder) or absolute path to configuration file
Launch as many servers as wanted by arguments
* `php src/server.php protocol=nex config=name.json` - launch `nex` protocol server with `name.json` config
* `config` - relative (to `config` folder) or absolute path to configuration file
* `protocol` - server protocol, supported options:
* `nex` - [NEX Protocol](https://nightfall.city/nex/info/specification.txt)

4
config/example.json

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
},
"server":
{
"nps":
"nex":
{
"host":"127.0.0.1",
"port":1900,
@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
"debug":
{
"enabled":true,
"template":"[{time}] [init] NPS server at {host}:{port}"
"template":"[{time}] [init] NEX protocol server at {host}:{port}"
}
},
"open":

4
src/Controller/Server/Nps.php → src/Controller/Server/Nex.php

@ -4,7 +4,7 @@ namespace Yggverse\Pulsar\Controller\Server; @@ -4,7 +4,7 @@ namespace Yggverse\Pulsar\Controller\Server;
use \Ratchet\MessageComponentInterface;
class Nps implements MessageComponentInterface
class Nex implements MessageComponentInterface
{
private object $_config;
@ -15,7 +15,7 @@ class Nps implements MessageComponentInterface @@ -15,7 +15,7 @@ class Nps implements MessageComponentInterface
\Yggverse\Pulsar\Model\Database $database
) {
// Init config
$this->_config = $config->get()->server->nps;
$this->_config = $config->get()->server->nex;
// Init database
$this->_database = $database;

8
src/server.php

@ -26,15 +26,15 @@ $database = new \Yggverse\Pulsar\Model\Database( @@ -26,15 +26,15 @@ $database = new \Yggverse\Pulsar\Model\Database(
// Start server
switch ($environment->get('protocol'))
{
case 'nps'|'NPS':
case 'nex':
$server = \Ratchet\Server\IoServer::factory(
new \Yggverse\Pulsar\Controller\Server\Nps(
new \Yggverse\Pulsar\Controller\Server\Nex(
$config,
$database
),
$config->get()->server->nps->port,
$config->get()->server->nps->host
$config->get()->server->nex->port,
$config->get()->server->nex->host
);
$server->run();

Loading…
Cancel
Save