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
htmlmacro - 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
:printdirective that prints the value of the included form
- to serve e.g.
- better client side
- more request types and POST data encodings
- automatic
404for requests the server doesn't handle
code is released under CC BY-SA 3.0
source code
file by file, including the ASDF definition:
- com.paskvil.uhttp.asd download
- com.paskvil.uhttp-package.lisp download
- com.paskvil.uhttp-server.lisp download
- com.paskvil.uhttp-client.lisp download
- com.paskvil.uhttp-html.lisp download
- com.paskvil.uhttp-helpers.lisp download
all in one: uhttp.tar.gz