emqx/esockd
68.0
Adequate · 2 October 2026
6.8k
lines of production code
Erlang
primary language
2
measurements over time
What this system is
This system is a high-performance, Erlang-based socket server framework designed for managing TCP, UDP, and DTLS connections. It provides core infrastructure for connection acceptance, proxy protocol integration, and secure TLS handling, supported by comprehensive testing and hot-upgrade capabilities. The project serves as a foundational library for building reliable network services with flexible socket tuning and lifecycle management.
Features
Added demo SSL certificate and private key for local development
A self-signed SSL certificate (demo.crt) and its corresponding RSA private key (demo.key) have been added to the priv directory. These files provide the necessary credentials for local development and testing of HTTPS/TLS connections, allowing users to run the application securely without needing external certificate authorities.
priv · high confidence
Introduction of UDP Proxy with connection lifecycle management
This change introduces the UDP proxy component, which converts UDP connections into long-lived connections within the application. It includes a PlantUML diagram documenting the proxy's behavior for handling multiple clients and load balancers, an ETS-based database (\esockd\_udp\_proxy\_db\) to track and manage connection attachments and detachments, and a connection abstraction module (\esockd\_udp\_proxy\_connection\) that standardizes callbacks for initializing, finding, dispatching, and closing connections.
_src/udp\proxy · high confidence
New example applications for TCP, UDP, DTLS, and Proxy Protocol
The examples directory now includes a comprehensive set of reference implementations demonstrating esockd capabilities. These include a simple TCP echo server, a gen\_server-based TCP echo server, and a plain TCP echo server. New examples cover UDP echo servers and DTLS echo servers (including PSK-based DTLS). The suite also features an async\_recv echo server, a benchmark for active\_n vs async\_recv, and a TCP window full test to illustrate send behavior. Additionally, a Proxy Protocol example is provided, showing integration with HAProxy using V2 protocol support.
examples · high confidence
esockd 5.9.9 release with hot-upgrade support and new socket-based acceptor
This release introduces a new socket-based acceptor implementation (esockd\_accept\_socket) alongside the existing inet-based one, enabling more flexible socket tuning and faster connection closure. It also adds comprehensive hot-upgrade instructions (appup) for versions 5.9.0 through 5.9.9, allowing seamless updates without downtime. The release includes fixes for UDP/DTLS listeners, improved proxy protocol handling, and better compatibility with recent OTP versions.
src · high confidence
Behavioural changes
New include headers defining proxy protocol fields and connection types
The library introduces two new header files, \esockd.hrl\ and \esockd\_proxy.hrl\, to standardize internal data structures and type definitions. \esockd.hrl\ defines the \proxy\_socket\ record, which now includes support for Proxy Protocol v2 additional fields (such as SSL client certificate details, ALPN, and authority), and introduces OTP 26 compatibility for SSL options. \esockd\_proxy.hrl\ establishes the core type definitions for the proxy subsystem, including \proxy\_transport\, \connection\_id\, and \proxy\_options\, facilitating the new proxy-based connection architecture.
include · high confidence
esockd rebrands to EMQX and updates licensing
The project has been renamed from esockd to EMQX, as reflected in the updated README and repository context. The software license has been changed from MIT to Apache License 2.0. Additionally, the build configuration now enforces a minimum Erlang/OTP version of 21.0 and includes a .tool-versions file specifying Erlang 28.1-1.
(repo-wide) · high confidence
Test coverage
Expanded test coverage for esockd core components and transport features; Updated test certificates for esockd.
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
Score
- CAI 68 → 68 (+0.2)
- Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 92 → 92 (+0.0)
- Architecture 100 → 84 (-15.6)
- Maturity 69 → 70 (+0.3)
- Readiness 59 → 59 (+0.0)
- Security 68 → 74 (+6.5)
- Event Sourcing 100 → 100 (+0.0)
Resolved (3)
- Coverage not measured — no coverage collector is wired up
- Documentation: no architecture or design documentation (README.md)
- Off-boarding risk: anonymized user #1
New (3)
- Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
Changes since last survey
- 9 commits — 1 feature/other, 8 fixes
By area
- (repo) — 3 commits
- src/esockd_socket_listener.erl — 2 commits
- src/esockd.erl — 1 commit
- src/esockd_accept_inet.erl — 1 commit
- src/esockd_accept_socket.erl — 1 commit
- src/esockd_proxy_protocol.erl — 1 commit
Notable commits
- fix: Merge pull request #233 from keynslug/fix/socket/fragmented-ppv1
- fix: Merge pull request #234 from keynslug/fix/socket/option-handling
- fix: fix(listener): set buffer options on the listening socket
- fix: fix(socket): handle v6only listener option
- fix: fix(socket): handle {tune_buffer, false} case correctly
- fix: fix(socket): reject fragmented PPv1 headers
- fix: fix: correct handling of valid tune socket options
- fix: fix: handle various edge cases in merge_opts/2
- change: Merge pull request #232 from emqx/260923-listen-socket-buffer-opts
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
emqx/esockd 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 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 28d3a40984bf87003a0ee8ebed361414aa12cd3a — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.