nex and nps
The other day I did a little searching around for other smolweb services and stubmled upon what could be the most simple solutions to send output and get input.
nex server
nex or Nightfall Express is a simple service for transmitting content. Using a simple socket and a one line request containing the content's path, the server can be implemented in a few dozen lines of shell code. I wrote down those lines and published it here.
nex-sh Git repo
The client is even more simple. It can be done in a single line of shell code.
#!/bin/sh
# rex client
echo "$2" | nc "$1" 1900 | less
You can try out my site with the following command:
echo "/" | nc sh0.xyz 1900 | less
Or if you have a browser that supports it
Nex page
nps server
nps or Nightfall Postal Service is a simple service for sending messages. It has basically one rule: All messages end with a line containing just a single `.` character. Just like `ed`. My script allows for two modes: File Upload and Script Mode
If you set the environment variable `OUT_DIR` all files are written to the directory specified. It just needs to end in a line with just a `.` character.
If the environment variable `OUT_SCRIPT` is set, the shell script it points to will be piped the lines via `stdin` and the output is sent back to the client via `stdout`.
SERVER
$ OUT_SCRIPT=example/is-valid.sh ./nps.sh
nps.sh server hosting [./example/is-valid.sh] running on port 1915...
2025-08-11T20:44:29:218743309 - 127.0.0.1 - Receiving data...
2025-08-11T20:44:29:218743309 - 127.0.0.1 - Action completed
CLIENT
$ telnet localhost 1915
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
THIS IS A TEST
The last line must be just a dot (.)
.
SERVER RESPONSE: Valid file with 4 lines.
Example Script:
#!/bin/sh
VALID_FILE=0
COUNT=0
while read -r line; do
line=$(echo "$line" | tr -d '\r')
COUNT=$((COUNT + 1))
if [ "$line" = "." ]; then
VALID_FILE=1
break
fi
done
if [ $VALID_FILE -eq 1 ]; then
echo "SERVER RESPONSE: Valid file with $COUNT lines."
else
echo "SERVER RESPONSE: Invalid file."
fi
Back