Skip to content
CAI
Software that uses CAICheck a score

ninenines/cowboy

65.3

Adequate · 10 November 2026

12.7k

lines of production code

Erlang

primary language

9

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Chunked Hello World example with release support

A new example demonstrating HTTP chunked transfer encoding has been added to the examples directory. The example includes source code for a Cowboy handler that streams responses in chunks, a release configuration using relx, and build instructions via erlang.mk. Users can now build and run this standalone release to observe chunked HTTP/1.1 and HTTP/2 responses.

_examples/chunked\_hello\world · high confidence

Add Cowboy WebSocket example with release support

A new WebSocket example has been added to the examples directory, demonstrating how to set up a Cowboy listener on port 8080 that serves a static index page and handles WebSocket connections. The example includes a handler that echoes received text messages with a prefix and sends periodic timeout messages. It is configured as a release using relx, allowing users to build and run it via make.

examples/websocket · high confidence

Add EventSource example application

A new example application demonstrating Server-Sent Events (SSE) using Cowboy has been added. It includes a release configuration via relx, a static HTML client that connects to the /eventsource endpoint, and an Erlang handler that streams periodic 'Tick' messages to the browser.

examples/eventsource · high confidence

Add Hello World example with HTTP/2 support and release packaging

A new Hello World example has been added to the examples directory, demonstrating how to build a Cowboy application using a release structure (via relx) and supporting both HTTP/1.1 and HTTP/2 protocols. The example includes a Makefile for building and running, a relx configuration for release management, and source files for the application, supervisor, and handler modules. Users can now run the example to see HTTP/1.1 responses via curl or HTTP/2 responses via nghttp2, providing a complete reference for setting up a basic Cowboy server with modern protocol support.

_examples/hello\world · high confidence

Add REST Hello World example with Cowboy and relx

The rest\_hello\_world example now provides a complete, runnable demonstration of a Cowboy REST application. It includes source code for a handler that serves HTML, JSON, and plain text responses based on content negotiation, a supervisor, and an application module that starts a Cowboy listener on port 8080. The example is built using erlang.mk and configured with relx to produce a standalone release, allowing users to easily build and run the service via 'make run'.

_examples/rest\_hello\world · high confidence

Add REST basic authentication example for Cowboy

A new example demonstrating how to implement basic HTTP authentication with Cowboy's REST handler has been added to the \examples/rest\_basic\_auth\ directory. The example includes the necessary application, supervisor, and handler source files, along with a Makefile and relx configuration to build and run the service. Users can now run the example to see how to protect REST endpoints, where unauthenticated requests receive a 401 Unauthorized response and authenticated requests (using the hardcoded credentials 'Alladin:open sesame') receive a 200 OK response.

_examples/rest\_basic\auth · high confidence

Add SSL Hello World example with HTTP/2 support

A new SSL Hello World example has been added to the examples directory, demonstrating a secure HTTPS server using Cowboy. The example includes a self-signed certificate and key, a release configuration via relx, and source code that starts a TLS listener on port 8443. It supports both HTTP/1.1 and HTTP/2 protocols, returning a 'Hello world!' response, and provides documentation on how to build and run the example using make.

_examples/echo\_get, examples/echo\_post, examples/ssl\_hello\world · high confidence

A new cookie example has been added to the examples directory, providing a complete Erlang application that demonstrates setting and reading cookies. The example includes a release configuration (relx), a Makefile for building, and source code for an application, supervisor, and handler. The handler sets a server-side cookie and reads both server and client-side cookies, rendering them in an HTML template via ErlyDTL. Users can build and run the example to see cookies in action at http://localhost:8080.

examples/cookie · high confidence

Add markdown\_middleware example with on-the-fly conversion

A new example demonstrates how to use a custom Cowboy middleware to serve static files while automatically converting Markdown sources to HTML. The example includes a \markdown\_converter\ middleware that checks if a \.md\ file is newer than its corresponding \.html\ output and regenerates it on request. It is packaged as a release using relx, listens on port 8080, and serves files from the \priv\ directory.

_examples/markdown\middleware · high confidence

Add multipart upload example

A new example application demonstrating how to handle multipart file uploads using Cowboy has been added. It includes a simple HTML form for selecting files, a handler that reads the uploaded part and logs the filename, content type, and data to the shell, and the necessary application and supervisor modules to run the server on port 8080.

examples/upload · high confidence

Cowboy 2.19.0 release with HTTP/3, WebTransport, and build system overhaul

This release introduces experimental HTTP/3 and WebTransport support, enabled via the COWBOY\_QUICER compile flag, and updates the project to version 2.19.0. The build system has been migrated from Rebar to Erlang.mk, introducing new targets for documentation, testing, and static analysis, while dependencies are pinned to Cowlib 2.20.0 and Ranch 1.8.1. Documentation has been converted to Asciidoc, and the project now includes an AGENTS.md guide for contributors and a comprehensive CONTRIBUTING.asciidoc file.

(repo-wide) · high confidence

Initial release of the Cowboy HTTP server

This entry introduces the Cowboy HTTP server library, providing a complete implementation for handling HTTP/1.1 and HTTP/2 protocols over TCP and SSL transports. The release includes core modules for managing listeners (\cowboy\), protocol handlers (\cowboy\_clear\, \cowboy\_tls\), and request/response processing (\cowboy\_req\). It also adds support for WebSockets, RESTful resource handling, static file serving, and various stream handlers for compression, metrics, and tracing. The library relies on Ranch for connection management and includes utilities for binary string manipulation and time formatting.

src · high confidence

New file server example with directory listing and UTF-8 support

The examples/file\_server directory now contains a complete, standalone Cowboy file server example that serves static files from the priv directory and provides a directory listing interface. The listing supports both HTML and JSON responses, handles UTF-8 encoded filenames (demonstrated by a Chinese-named directory), and includes a middleware component to redirect directory requests to the handler. The example is configured to run on port 8080 and includes documentation and test assets.

_examples/file\server · high confidence

Removals

Removal of legacy HTTP type and record definitions

The \include/http.hrl\ and \include/types.hrl\ header files have been removed from the project. This deletion eliminates the legacy Erlang record definitions for HTTP requests (\\#http\_req\) and various type specifications (such as \http\_method\, \http\_uri\, \http\_version\, and dispatch rules) that were previously used for internal type checking and documentation. Users relying on these specific include files for custom type definitions or record patterns will need to update their code to use the current API or remove these dependencies, as these low-level structural definitions are no longer provided in the public include directory.

include · high confidence

Behavioural changes

Compressed response example now uses automatic compression handler

The compress\_response example has been updated to demonstrate automatic response body compression using the new cowboy\_compress\_h stream handler. The application now configures the HTTP listener to include cowboy\_compress\_h in its stream handlers, allowing responses to be automatically compressed (e.g., gzip) when the client supports it, as shown in the updated README with both HTTP/1.1 and HTTP/2 examples.

_examples/compress\response · high confidence

Cowboy User Guide converted to Asciidoc

The documentation source has been migrated from its previous format to Asciidoc. This change introduces a new book structure (book.asciidoc) that organizes the guide into logical sections including Introduction, Configuration, Handlers, Request and response, REST, Websocket, Advanced topics, and a comprehensive set of migration guides for versions 1.0 through 2.18. The conversion also includes new or updated chapters for constraints, cookies, listeners, loop handlers, middlewares, and the flow diagram, providing a more structured and maintainable documentation base for users.

doc/src/guide · high confidence

Cowboy manual converted to Asciidoc with new listener management and constraint functions

The Cowboy documentation has been converted to Asciidoc format, introducing new manual pages for listener management functions \cowboy:get\_env/2,3\ and \cowboy:set\_env/3\ (introduced in 2.11) which allow retrieving and updating listener environment values, and \cowboy\_constraints:from\_fun/1\ (introduced in 2.15) which enables creating custom constraints from 1-arity functions. The manual also documents the \cowboy:start\_clear/3\ and \cowboy:start\_tls/3\ functions that replace the older \start\_http\ and \start\_https\ APIs, and includes updated documentation for stream handlers like \cowboy\_compress\_h\ and the new \cowboy\_decompress\_h\.

doc/src/manual · high confidence

Examples documentation converted to AsciiDoc

The README for the examples directory has been converted from Markdown to AsciiDoc format, providing a standardized documentation structure for the available Cowboy examples such as chunked transfer, SSL, and WebSocket demonstrations.

examples · high confidence

REST pastebin example converted to a release with syntax highlighting and input validation

The REST pastebin example has been restructured into a standalone release using relx, simplifying build and run instructions via a Makefile. Functionally, the example now accepts a broader range of media types for input and enforces a constraint on the 'lang' query parameter to validate syntax highlighting languages. It also includes a web interface for submitting pastes and supports syntax-highlighted output via the 'highlight' tool when requested.

_examples/rest\pastebin · high confidence

Release version 2.19.0 with HTTP/3 and WebTransport support

The Cowboy HTTP server has been updated to version 2.19.0. This release includes the application metadata for the new version and registers modules supporting HTTP/3 (via \cowboy\_http3\ and \cowboy\_quicer\) and WebTransport (\cowboy\_webtransport\), alongside other stream handlers like compression, decompression, metrics, and tracing.

ebin · high confidence

WebSocket example now uses current host for connection URL

The WebSocket client example has been updated to automatically use the current host as the base URL for the WebSocket connection. This change simplifies the setup process by removing the need to manually configure the server address, allowing users to test the example directly by navigating to the page in their browser.

examples/websocket/priv · high confidence

Test coverage

Added WebSocket handler test fixtures; Added documentation for RFC6585 and RFC7230 HTTP/1.1 server specifications; Added test suites for response compression and request decompression; Expanded test coverage for Cowboy handler callbacks and request/response APIs.

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 62 → 65 (+3.4)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 75 → 75 (-0.0)
  • Architecture 89 → 100 (+10.5)
  • Maturity 52 → 52 (-0.5)
  • Readiness 59 → 68 (+9.2)
  • Security 89 → 99 (+10.0)

Resolved (7)

  • Duplicated block (6 lines × 2) (src/cowboy_http.erl)
  • Duplicated block (8 lines × 2) (src/cowboy_metrics_h.erl)
  • Leaked secret: private-key (examples/ssl_hello_world/priv/ssl/key.pem)
  • Projects may be oversized for their cohesion
  • Rotate the exposed credentials — git history can't be un-committed
  • Secret: private-key (examples/ssl_hello_world/priv/ssl/key.pem)
  • Secret: private-key (examples/ssl_hello_world/priv/ssl/server.key)

New (2)

  • Duplicated block (5 lines × 2) (src/cowboy_http2.erl)
  • Hotspot: src/cowboy_http.erl (src/cowboy_http.erl)

Changes since last survey

  • 21 commits — 17 feature/other, 4 fixes

By area

  • src/cowboy_http.erl — 7 commits
  • doc/src — 5 commits
  • src/cowboy_http2.erl — 3 commits
  • (root) — 2 commits
  • src/cowboy_rest.erl — 2 commits
  • src/cowboy_static.erl — 1 commit
  • test/ws_SUITE.erl — 1 commit

Notable commits

  • fix: Fix Content-Range when a byte range ends outside the body
  • fix: Fix HTTP/2 header table size types
  • fix: Fix HTTP/2 max_concurrent_streams type
  • fix: Fix a ws_SUITE max_frame_size race on Windows
  • change: Add the max_header_list_size HTTP/2 option
  • change: Allow undefined as ProxyHeader argument to cowboy_http:init/6
  • change: Cowboy 2.21.0
  • change: Credit the HTTP/2 window for discarded DATA
  • change: Fix typos and grammar errors in documentation
  • change: HTTP/1.1: Reject non-token characters in header names
  • change: HTTP/1: Do not close length-less HEAD responses
  • change: HTTP/1: Finish HEAD responses when the headers are sent
  • change: HTTP/1: Keep the connection open after a HEAD stream_reply
  • change: HTTP/2: Finish HEAD responses when the headers are sent
  • change: Make the guide diagrams readable in dark mode
  • change: Remove .ez archive support from cowboy_static
  • change: Reset HTTP/2 CONNECT and TRACE after the 501
  • change: Send the whole body when a byte-range set is larger
  • change: Set SO_LINGER to {true, 0} before the linger loop
  • change: Stop buffering pipelined HTTP/1 data while a request is in progress
  • …and 1 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ninenines/cowboy was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 10 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 4bb716bda86df0bfc9b03bfdeaba9e2749484b99 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.