From 832d40c6a3c7eec0612fea79b3a32fa4336b2dc0 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 26 Apr 2024 22:47:12 +0300 Subject: [PATCH] update readme --- README.md | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9d32f7f..bf43e31 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,40 @@ PHP 8 Server for [Nex Protocol](nex://piclog.blue/nex/info/specification.txt), b ## Install * `git clone https://github.com/YGGverse/next.git` -* `cd next` -* `composer update` +* `cd next` - navigate the server directory +* `composer update` - get latest dependencies -## Start +## NEX + +Optimal to serve static files + +For security reasons, next server prevents any access to the hidden files (started with dot) + +### Start + +Create as many servers as wanted by providing separated `host` and `port` using optional arguments ``` bash -php src/nex.php\ - host=127.0.0.1\ - port=1900\ - path=/path/to/dir +php src/nex.php host=127.0.0.1 port=1900 path=/target/dir ``` -### Options +#### Arguments + +##### Required + +* `path` - **absolute path** to the public directory + +##### Optional -* `host` - optional string, `127.0.0.1` by default -* `port` - optional int, `1900` by default -* `path` - required string, destination files location (public folder) \ No newline at end of file +* `host` - `127.0.0.1` by default +* `port` - `1900` by default +* `file` - index **file name** that server try to open in path requested, disabled by default +* `fail` - failure **file path** that contain template (e.g. `error.gmi`) for the error handler, `fail` text by default +* `list` - show content listing in the requested directory (when index file not found or not defined), enabled by default +* `size` - limit request length in bytes, `1024` by default +* `dump` - dump server queries, keep argument value blank to disable, default mask: `[{time}] [{code}] {host}:{port} {path}` + * `{time}` - event time in `c` format + * `{code}` - formal response code: `1` - found, `0` - not found + * `{host}` - peer host + * `{port}` - peer port + * `{path}` - path requested