Re: HTTP request handler / middleware SRFI
Peter 05 Apr 2019 13:20 UTC
I have a working SCGI implementation for both MIT and chez scheme
(ported, not the same codebase, but only superficial differences).
It is rather ugly code, but I've used it in production with both nginx
and apache, and it seems to work fine. It is written purely in Scheme.
Headers are passed as alists, bodies as bytevectors / strings. This is
not ideal, sometimes it would be better to be able to write content
directly, but I haven't figured out how to properly do this *and*
support custom headers nicely. Also, there is no portable way to have
custom ports in Scheme, so that makes things even harder :-/
I'd strongly suggest implementing this and getting it stable before
writing an actual SRFI for it.
Greetings, Peter