Skip to content

clojars/http-kit

 
 

Repository files navigation

http-kit
API | Wiki | Slack | Latest releases: v2.8.1 or v2.9.0-beta3

Main tests Graal tests

Note

This is a fork of http-kit that adds support for custom status messages. Clojars uses these to signal reasons for deploy failure, but they are deprecated, and aren't part of the ring spec. Clojars plans to stop using them once problem details support is added and has propagated to tooling.

This fork is deployed to Clojars as net.clojars.internal/http-kit.

http-kit

Simple, high-performance event-driven HTTP client+server for Clojure

http-kit is a minimalist and efficient Ring-compatible HTTP client+server for Clojure.

It uses an event-driven architecture to support highly concurrent a/synchronous web applications, and features a simple unified API for WebSocket and HTTP long-polling/streaming.

Why http-kit?

  • Ring compliant: http-kit is a drop-in replacement for the standard Ring Jetty adapter. You can use it with all your current libraries and middleware.

  • High performance: http-kit uses an event-driven architecture like nginx, and is fast. See here for benchmarks.

  • High concurrency: http-kit is efficient. Its RAM usage is O(n), with only few kB used per connection. Tests have shown http-kit happily serving >600k concurrent connections.

  • Clean, simple, small: written from the ground-up to be lean, the entire http-kit client+server JAR is ~90kB with zero dependencies and ~3k total lines of code.

  • Sync or async: synchronous is simple, asynchronous 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.

  • WebSockets: realtime web apps are a breeze with http-kit, with great out-the-box support for both WebSockets and efficient HTTP long-polling.

Production usage

For production environments, it's strongly recommended to run http-kit behind a well-configured and battle-hardened reverse proxy like nginx, Caddy, HAProxy, AWS ALB, etc.

See here for more info.

Performance

http-kit now includes an extensive single-system benchmark suite that can be easily customized and run in your own environment.

See here for http-kit's benchmark philosophy, usage info, detailed results, etc.

Selected example results:

Important: as with all benchmarks - please be skeptical and check the details for important context!

chart-server-work-0

chart-client-https

Project status

http-kit was created by @shenfeng, but is currently being maintained by its community.

A big thank-you to the current contributors for keeping the project going! Additional contributors very welcome: please ping me if you'd be interested in lending a hand.

- Peter Taoussanis

Documentation

License

Copyright © 2012-2025 Feng Shen and contributors.
Licensed under Apache 2.0.

About

Simple, high-performance event-driven HTTP client+server for Clojure

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 61.0%
  • Clojure 35.8%
  • Shell 1.2%
  • C 1.1%
  • Go 0.5%
  • Lua 0.2%
  • Other 0.2%