Skip to content

Instantly share code, notes, and snippets.

@malcolmsparks
Created December 22, 2014 14:40
Show Gist options
  • Save malcolmsparks/473ece4b4905dadb0dc4 to your computer and use it in GitHub Desktop.
Save malcolmsparks/473ece4b4905dadb0dc4 to your computer and use it in GitHub Desktop.
aleph seems to hang
(defproject alephplay "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0-alpha4"]
[aleph "0.4.0-alpha9" :exclusions [org.clojure/clojure]]])
(ns alephplay.core
(:require
[aleph.http :as http]
[manifold.deferred :as d]))
(def server
(http/start-server
(fn [req]
(d/let-flow [status (future 200)]
{:status status :body "Hello World!"}))
{:port 8080}))
;; This works on the first connection to 8080, but the client hangs on every subsequent connection.
$ curl -i localhost:8080
HTTP/1.1 200 OK
Server: Aleph/0.4.0
Connection: Keep-Alive
Date: Mon, 22 Dec 2014 14:35:26 GMT
Content-Length: 12
Hello World!
$ curl -i localhost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment