HTTP client/server for Clojure

HTTP Kit is a minimalist, efficient,
Ring-compatible HTTP client/server for Clojure. It
uses a event-driven architecture to support
highly concurrent a/synchronous web applications.
Feature a unified API for WebSocket and HTTP long polling/streaming

[http-kit"2.2.0"]; Add to your project.clj.

Recent Blog Posts

(defnasync-handler[ring-request];; unified API for WebSocket and HTTP long polling/streaming
(with-channelring-requestchannel; get the channel
(if(websocket?channel); if you want to distinguish them
(on-receivechannel(fn[data]; two way communication
(send!channeldata)))(send!channel{:status200:headers{"Content-Type""text/plain"}:body"Long polling?"}))))(run-serverasync-handler{:port8080});Ringserver

Ring Compliant

HTTP Kit is an (almost) drop-in
replacement for the standard Ring Jetty adapter. So you can use it
with all your current libraries
(e.g. Compojure)
and middleware.

High Performance

Using an event-driven architecture like Nginx, HTTP-kit
is
very, very fast. It comfortably handles tens of thousands of
requests/sec on even midrange hardware.
Here is another test about how it stacks up with others.

High Concurrency

It's not only fast,
but efficient!
Each connection costs nothing but a few kB of memory. RAM usage grows O(n) with connections.

Clean, Simple, Small

Written from the ground-up to be lean, the entire client/server is
available as a single ~90kB JAR with zero dependencies and
~3k lines of (mostly Java) code.

Sync or Async

Synchronous is simple. Asynchronous is fast & flexible. With
HTTP Kit you get the best of both with a simple API that lets you
mix & match to best fit your use case.