ninenines/ranch
67.6
Adequate · 23 September 2026
3.8k
lines of production code
Erlang
primary language
5
measurements over time
What this system is
Ranch is a socket acceptor pool for TCP protocols that manages listener lifecycle, transport handshakes, and connection supervision. It supports custom transport implementations, PROXY protocol headers, and TLS handshakes, while providing robust concurrency stability and graceful shutdown mechanisms. The system enables developers to build and integrate TCP-based services with modern API patterns and comprehensive testing coverage.
Features
Add TCP Echo protocol example
A new TCP echo example has been added to demonstrate a Ranch protocol implementation. The example includes a release configuration and build instructions, allowing users to start a server on port 5555 that echoes back received data. It utilizes the modern Ranch API, specifically \ranch:handshake/1\ and the Transport module for socket operations, and includes a 60-second timeout for inactivity.
_examples/tcp\echo · high confidence
Initial release of Ranch 2.3.0
This entry introduces Ranch version 2.3.0, a socket acceptor pool for TCP protocols. The release includes the core application code, a Makefile-based build system using erlang.mk, and updated documentation in Asciidoc format (README.asciidoc, User Guide, and Function Reference). It also establishes the project's ISC license and initial test infrastructure.
(repo-wide) · high confidence
New TCP reverse example using gen\_statem
Added a new example demonstrating a TCP reverse protocol implementation using gen\_statem instead of gen\_server. The example listens on port 5555, reverses input text, and includes a 60-second inactivity timeout before disconnecting. It also updates the dependency to use the Ranch master branch and modernizes the code to use the new transport options format and Transport:handshake/1.
_examples/tcp\reverse · high confidence
Ranch 2.3.0 release with upgrade instructions and new transport behaviors
This release introduces the \ranch\_transport\ and \ranch\_protocol\ behaviours, allowing custom transport implementations and separating connection supervision from the protocol logic. It adds support for the PROXY protocol (v1 and v2) via \ranch\_proxy\_header\, enables TLS handshakes on existing sockets, and allows connection processes to be supervisors. The \ranch.appup\ file provides upgrade instructions from 2.1.x and 2.2.x to 2.3.0, detailing the necessary module updates and acceptor restarts.
src · high confidence
Behavioural changes
Ranch User Guide converted to Asciidoc with comprehensive migration documentation
The Ranch documentation has been converted from its previous format to Asciidoc, restructured into a cohesive book with dedicated chapters for Listeners, Transports, Protocols, Embedded mode, and Internals. This update introduces new guides for writing parsers and configuring SSL client authentication, and adds a detailed section on connection draining to help users gracefully stop listeners. Crucially, the guide now includes a series of migration appendices covering upgrades from Ranch 1.5 through 2.2 to 2.3, documenting breaking changes such as the removal of the \Socket\ argument from protocol handlers, the shift to map-based options, and the new \ranch:handshake/1,2\ API.
doc/src/guide · high confidence
Ranch documentation converted to Asciidoc with expanded API coverage
The manual pages in doc/src/manual have been converted to Asciidoc format and significantly expanded to document new and updated API functions. This includes detailed documentation for listener suspension and resumption, transport handshake control (including pause, resume, and cancel), and new introspection functions like ranch:info/0, ranch:procs/2, and ranch:get\_addr/1. The documentation also reflects behavioral changes such as the removal of the Socket argument from ranch\_protocol:start\_link, the shift to map-based transport options, and the addition of PROXY protocol header support and TLS handshake capabilities.
doc/src/manual · high confidence
Test coverage
Expanded test coverage for listener lifecycle, transport features, and concurrency stability
The test suite now includes comprehensive suites for acceptor behavior, proxy protocol header parsing (v1 and v2), file sendfile operations, and listener shutdown modes (including brutal\_kill, timeout, and infinity). New test protocols and transport mocks validate handshake continuations, active N mode, connection removal, and embedded supervisor interactions. Concurrency stability is verified through Concuerror checks and stampede-based stress tests for TCP, SSL, and embedded listeners, ensuring robustness under rapid start/stop cycles and high connection volumes.
test · high confidence
Dependencies
Ranch library updated to version 2.3.0
The Ranch socket acceptor pool has been updated to version 2.3.0, as reflected in the regenerated application metadata file. This version bump includes the addition of the ssl application to the required dependencies list, ensuring that SSL/TLS functionality is properly resolved at runtime.
ebin · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 61 → 68 (+6.6)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 83 → 92 (+9.3)
- Architecture 100 → 100 (+0.0)
- Maturity 56 → 56 (+0.5)
- Readiness 45 → 57 (+11.7)
- Security 100 → 100 (+0.0)
- Event Sourcing 100 → 100 (+0.0)
Resolved (7)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- No exposed public API
- Off-boarding risk: anonymized user #1
- Test reliability not included
- TooManyMethods: ranch (src/ranch.erl)
- complexity unreadable for .erl — churn × complexity hotspots could not be measured
New (16)
- Coverage not measured — no coverage collector is wired up
- Documentation: no installation or build instructions
- Documentation: no usage examples
- Duplicated block (10 lines × 2) (src/ranch_ssl.erl)
- Duplicated block (5 lines × 2) (examples/tcp_echo/src/tcp_echo_app.erl)
- Duplicated block (7 lines × 2) (examples/tcp_echo/src/tcp_echo_sup.erl)
- Duplicated block (8 lines × 2) (src/ranch_conns_sup.erl)
- High: security finding (details withheld)
- Hotspot: src/ranch_proxy_header.erl (src/ranch_proxy_header.erl)
- Off-boarding risk: anonymized user #1
- TodoComment (src/ranch_acceptors_sup.erl)
- TodoComment (src/ranch_acceptors_sup.erl)
- TodoComment (src/ranch_transport.erl)
- Workflow token permissions not restricted
- ranch_conns_sup.loop (cognitive 23) (src/ranch_conns_sup.erl)
- ranch_conns_sup.loop (cyclomatic 37) (src/ranch_conns_sup.erl)
Changes since last survey
- 9 commits — 9 feature/other, 0 fixes
By area
- test/acceptor_SUITE.erl — 4 commits
- (root) — 2 commits
- doc/src — 1 commit
- test/handshake_protocol.erl — 1 commit
- test/ranch_ct_hook.erl — 1 commit
Notable commits
- change: Drop OTP-22 SNI workaround in handshake_protocol
- change: Drop TLS 1.2 pin in ssl_sni_fail test
- change: Drop Windows ssl internal_active_n test workaround
- change: Enable remaining tcp_socket tests
- change: Expect only OTP-26+ ssl option errors in tests
- change: Ranch 2.3.0
- change: Require Erlang/OTP 27+
- change: Set proc_lib labels on listener processes
- change: Simplify socket backend test detection
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ninenines/ranch 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 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 9e6257cc2d22951dd555571c402e8f86af7f7698 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.