PHP 8 Server for Nex Protocol
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.

46 lines
1.5 KiB

7 months ago
# next
7 months ago
7 months ago
PHP 8 Server for [Nex Protocol](nex://piclog.blue/nex/info/specification.txt), based on the [nex-php](https://github.com/YGGverse/nex-php) library
7 months ago
## Install
* `git clone https://github.com/YGGverse/next.git`
7 months ago
* `cd next` - navigate into the server directory
* `composer update` - grab latest dependencies
7 months ago
7 months ago
## NEX
Optimal to serve static files
For security reasons, next server prevents any access to the hidden files (started with dot)
### Start
7 months ago
Create as many servers as wanted by providing different `host` and `port` using optional arguments
7 months ago
``` bash
7 months ago
php src/nex.php host=127.0.0.1 port=1900 path=/target/dir
7 months ago
```
7 months ago
#### Arguments
##### Required
* `path` - **absolute path** to the public directory
##### Optional
7 months ago
7 months ago
* `host` - `127.0.0.1` by default
* `port` - `1900` by default
7 months ago
* `file` - index **filename** that server try to open in path requested, disabled by default
* `fail` - failure **filepath** that contain template (e.g. `error.gmi`) for the error handler, `fail` text by default
7 months ago
* `list` - show content listing in the requested directory (when index file not found), `yes` by default
7 months ago
* `size` - limit request length in bytes, `1024` by default
7 months ago
* `dump` - dump queries or set blank to disable, default: `[{time}] [{code}] {host}:{port} {path} {goal}`
7 months ago
* `{time}` - event time in `c` format
* `{code}` - formal response code: `1` - found, `0` - not found
* `{host}` - peer host
* `{port}` - peer port
* `{path}` - path requested
7 months ago
* `{goal}` - goal destination returned