paskvil

up: projects

UHTTP

a learning implementation of an HTTP server in Common Lisp

started off as a simple test of how usocket works, and grew a bit in size

what's in it:

  • headers retrieval
  • parsing of GET args and urlencoded POST data
  • in-code HTML generation, etc.

this is v0.1.0. the server side has pretty much all there is to it, topped with the with-accepted-client macro - a one-liner server "function", all that's left for you is to respond. the client side is minimal - just connect, read and write

on the todo list:

  • smarter html macro - it doesn't tell commands from values right now
    • to serve e.g. (car lst) you have to bind it to a new variable first, or print it to *standard-output* yourself
    • fix is probably a :print directive that prints the value of the included form
  • better client side
  • more request types and POST data encodings
  • automatic 404 for requests the server doesn't handle

code is released under CC BY-SA 3.0

source code

file by file, including the ASDF definition:

all in one: uhttp.tar.gz GZ, 4.3 kB