Welcome to the CHICKEN Scheme pasting service
spiffy chunks added by carld on Wed Jan 25 16:31:51 2012
(use spiffy intarweb) (define chunks (list "Hello" "World")) (define (send-chunked path) (with-headers `((Connection close) (Transfer-Encoding chunked)) (lambda () (write-logged-response))) (with-output-to-port (response-port (current-response)) (lambda () (map (lambda(chunk) (printf "~X\x0d\x0a~A\x0d\x0a~!" (string-length chunk) chunk)) chunks) (printf "0\x0d\x0a\x0d\x0a~!")))) (vhost-map `((".*" . ,(lambda (continue) (parameterize ((handle-not-found send-chunked)) (continue)))))) (server-port 8080) (start-server)