(hunchentoot:define-easy-handler (repl :uri "/repl") () (format t "Got here... ~A~%" (hunchentoot:within-request-p)) (setf (hunchentoot:content-type*) "text/event-stream") (setf *temp-stream* (hunchentoot:detach-socket hunchentoot:*acceptor*)) (let ((stream (hunchentoot:send-headers))) (format t "~&And here... ~a~%" (type-of stream)) (setf *temp-stream2* stream) (loop for i from 1 to 5 doing (progn (write-sequence (flexi-streams:string-to-octets (format nil "~&data: here is event #~d for thread #1~%" i) :external-format :utf8) stream) (finish-output stream) (format t "~&Sent event #~d (~A) (~A)~%" i *temp-stream* stream) (sleep 2)))))