Skip to content
CAI
Software that uses CAICheck a score

seriyps/mtproto_proxy

53.0

Adequate · 13 November 2026

5.2k

lines of production code

Erlang

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a high-concurrency proxy service built on Erlang/OTP, designed to manage secure, distributed communications between front-end and back-end nodes. It implements a layered codec architecture that handles protocol translation, encryption, and packet formatting for multiple network layers. The system supports split-mode deployments with automated TLS certificate generation for secure inter-node communication, ensuring reliable data encoding and decoding through comprehensive benchmarking and property-based testing.

Features

Added configuration files for split-mode (front/back node) deployment

Added example configuration files for deploying the proxy in a split-mode architecture, separating front-end (client-facing) and back-end (Telegram-facing) nodes. This includes distinct sys.config and vm.args templates for each role, along with systemd service units for the Erlang Port Mapper Daemon (epmd) and the proxy itself, enabling users to run distributed, high-concurrency setups with secure inter-node communication.

config · high confidence

Added script to generate TLS certificates for Erlang distribution

A new shell script, scripts/gen\_dist\_certs.sh, has been added to automate the generation of TLS certificates for Erlang distribution. The script supports a two-step process: an 'init' command to create a Certificate Authority (CA) and a 'back' node certificate, followed by 'add-node' commands to generate certificates for each front server. The script outputs PEM certificates, private keys, and ready-to-use Erlang TLS configuration files (ssl\dist.\.conf) to a specified output directory, simplifying the setup of secure inter-node communication.

scripts · high confidence

Introduces new codec architecture with dedicated modules for each protocol layer

The codebase now implements a layered codec architecture where the central \mtp\_codec\ module orchestrates the pipeline of TLS, crypto, and packet codecs. This change introduces new modules for each layer: \mtp\_abridged\, \mtp\_full\, \mtp\_intermediate\, and \mtp\_secure\ handle packet-level formatting, while \mtp\_aes\_cbc\ handles the encryption layer. Additionally, \mtp\_fake\_tls\ provides a fake TLS implementation for domain fronting, and \mtp\_config\ manages datacenter configuration and secrets. This structure allows for easier maintenance and testing of each protocol component independently.

src · high confidence

Test coverage

Added benchmarking and property-based tests for codecs

Added benchmarking modules (bench\_codec\_decode.erl, bench\_codec\_encode.erl) to measure the performance of various codec implementations including mtp\_fake\_tls, mtp\_intermediate, mtp\_secure, mtp\_full, mtp\_aes\_cbc, and mtp\_obfuscated. Additionally, introduced property-based tests (prop\mtp\\*.erl) to verify the correctness of encoding and decoding for all codec types, ensuring that data can be round-tripped without loss. New test helper modules (mtp\_test\_client, mtp\_test\_middle\_server, mtp\_test\_datacenter, mtp\_test\_echo\_rpc, mtp\_test\_metric, mtp\_test\_reporter\_rpc) and data generators (mtp\_prop\_gen) support these tests.

test · high confidence

Dependencies

Modernize build system and dependencies

The project has been modernized by removing the \lager\ logging library in favor of the native Erlang/OTP logger, and upgrading the \ranch\ dependency from version 1.5.0 to 2.2.0. The \goldrush\ dependency has also been removed. Additionally, a new \erlang\_psq\ dependency was added via Git.

(repo-wide) · high confidence

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 53 → 53 (-0.4)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 93 → 93 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 63 → 61 (-2.7)
  • Readiness 57 → 57 (+0.0)
  • Security 98 → 97 (-1.4)
  • Event-Driven 35 → 35 (+0.0)
  • Event Sourcing 100 → 100 (+0.0)
  • Performance 85 → 85 (+0.0)

Resolved (2)

  • Hotspot: src/mtp_handler.erl (src/mtp_handler.erl)
  • No ADRs found

New (7)

  • Edited copy of a member (10 corresponding lines) (src/mtp_down_conn.erl)
  • Edited copy of a member (11 corresponding lines) (src/mtp_session_storage.erl)
  • Edited copy of a member (13 corresponding lines) (src/mtp_dc_pool_sup.erl)
  • Edited copy of a member (25 corresponding lines) (src/mtp_down_conn.erl)
  • Edited copy of a member (4 corresponding lines) (src/mtp_obfuscated.erl)
  • Edited copy of a member (7 corresponding lines) (src/mtp_handler.erl)
  • No ADRs found (rebar.config)

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

Survey your own repository

seriyps/mtproto_proxy 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 13 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 154a8fb8e6ef85460f502d4b74434a22a5836937 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — 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.61+preprod-b8b1a43ae4c3.