echoserver - echo / discard server
echoserver is a single threaded server, handling packets coming in on one or more UDP or TCP server sockets and echoing them back to the sender.
options is a is a series of getopt or getopt_long style options. See below for more information.
The server sockets have to be created before. Usually this is done by tcpsocket or udpsocket.
echoserver is a demonstration code.
This option is useless unless used together with -r.
The use with an argument shows the long helptext of that option, without an argument it will list all options.
The use with an argument shows the long help for this option, without arguments it shows the long description of all options.
echoserver implements a simple kind of access control, utilizing a constant database (CDB) file, which is re-opened every 60 seconds.
echoservers rule files are compiled by the tcprules utility from Daniel Bernsteins ucspi-tcp package:
tcprules CDB-filename TMP-filename <rules-filenameSee the ucspi-tcp home page for more information.
echoservers rule resolution is like that of tcpserver, and the rule format is like that of tcprules, with the following exceptions:
1. There is nothing like $TCPREMOTEINFO in echoserver. 2. The $TCPREMOTEIP environment variable is not used, but the IP address of the remote host is used instead. 3. The $TCPREMOTEHOST environment variable is not used, but the host name of the remote host is used instead. 4. echoserver doesn't set environment variables, but honors the "limit" variable, which limits how many bytes are echoed back during two periods (0 means "no limit").
22.214.171.124-31:allow,limit="0" 194.245.:allow,limit="128000" :deny
How to start echoserver:
tcpsocket 0 7 \ udpsocket 0 7 \ echoserver -r rules.cdb