summaryrefslogtreecommitdiffhomepage
path: root/plop.1
blob: f6384638c3aacff22dfdcafcc6930bb474b6d84d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.TH plop 1 "2021-03-05"
.SH NAME
plop \- framework for prototyping protocols and servers
.SH SYNOPSIS
.SY plop
.OP \-p PORT
.OP \-h
.RI [ HANDLER ]
.YS
.SH DESCRIPTION
.B plop
loads
.IR HANDLER
Lua script and starts a TCP server listening on a designated
.IR PORT .
.P
If
.IR PORT
is not specified server starts listening on
.B 8080
by default.
.P
If
.IR HANDLER
is not specified then default path defined during compilation is used instead. The script is loaded as if
.B require
was used with module name
.B handler
and the return value is set as global variable with the same name. Loaded script is expected to return a function which
will be used to handle each connection over it's entire lifetime.
.P
If
.B \-h
option is used a short help message is printed out to standard error output, and then program is terminated. This short
message contains default value of
.IR HANDLER .