Skip to content

[Daemon] simple IP services

Howard edited this page Jan 28, 2020 · 2 revisions

Introduction

The simple IP services implement standard Internet services that were used in the nostalgic era of computing.

The three services are:

  • Active system user names (sysstat) - rfc866
  • Date and time (daytime) - rfc867
  • quote of the day (QOTD) - rfc865

Configuration

Construct the following JSON object and place it under key SimpleIPSvcDaemon in configuration file:

Property Type Meaning Default value
Address string The address network to listen on. "0.0.0.0" - listen on all network interfaces.
PerIPLimit integer Maximum number of requests a client (identified by IP) may make in a second. 6 - good enough for most cases
ActiveUsersPort integer TCP and UDP port number to listen on for "sysstat" (active users) service. 11 - the well-known port number designated for the service.
ActiveUserNames string A single line of text to respond to "sysstat" service clients. Empty string
DayTimePort integer TCP and UDP port number to listen on for "daytime" service. 13 - the well-known port number designated for the service.
QOTDPort integer TCP and UDP port number to listen on for "QOTD" service. 17 - the well-known port number designated for the service.
QOTD string A single line of text to respond to "QOTD" service clients. Empty string

Here is a minimal setup example:

{
    ...

    "SimpleIPSvcDaemon": {
        "ActiveUserNames": "matti",
        "QOTD": "cheese cake is delicious"
    },

    ...
}

Run

Tell laitos to run the daemon in the command line:

sudo ./laitos -config <CONFIG FILE> -daemons ...,simpleipsvcd,...

Usage

Contact the three services via either TCP or UDP, for example via the netcat command:

> nc localhost 11
matti
^C
> $ nc localhost 13
2019-02-25T17:25:34Z
^C
> nc localhost 17
cheese cake is delicious
^C

Keep in mind that UDP behaves differently - the client needs to send something before server responds:

> nc -u localhost 11
something
matti
^C
> nc -u localhost 13
something
2019-02-25T17:29:14Z
^C
> nc -u localhost 17
somethjing
cheese cake is delicious
^C
Clone this wiki locally