This is one of the protocols that I’m kind of surprised isn’t in more use, by virtue of its simplicity in implementation. RFC 865 is a layer 7 debugging RFC where a socket listens for a TCP or UDP connection, and then sends a short, arbitrary message.
#!/usr/bin/env ruby require "socket" QOTD_PORT = 17 # Change to higher number port to run as normal user server = TCPServer.new QOTD_PORT loop do client = server.accept client.puts "Hello world!" client.close end
RFC 865 recommends the character set be limited to ASCII (RFC 20/STD 80), and that you keep the character limit to 512 characters. There’s a lot of things you could do with 512 characters, so just for fun I’ve come up with a list of creative things you can do in that amount of space.
- A daily blog
- Sudoku puzzles
- ASCII art
- Box scores of today’s baseball game
- Chess puzzles
- Pipe output from the fortune program
- Weather forecasts
- Serial fiction
- AND SO MUCH MORE