On Sat, May 18, 2019 at 08:11:20PM +0200, Alexander Burger wrote:
> You can easily write a stand-alone server without any library:
> ...

Hmm, this was too short. I haven't tested, but at least we should respond
something. Perhaps this is a better starting point:

   (setq *Port (port 8080))

   (loop
      (setq *Sock (listen *Port))
      (unless (fork)
         (close *Port)
         (in *Sock
            (when (from "Content-Length: ")
               (let Len (read)
                  (while (line))  # Skip rest of header
                  (out NIL (echo Len)) ) ) )
         (out *Sock
            (prinl "HTTP/1.1 200 OK^M")
            (prinl "Content-Length: 0^M^J^M")
            (prinl "^M")
            (prinl "^M") )
         (bye) )
      (close *Sock) )

Just for experimentation ... ;)

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to