mirror of
https://github.com/seriyps/mtproto_proxy.git
synced 2026-09-24 05:34:28 +00:00
Adds `node_role = front | back | both` (default `both` — no behaviour change).
In split mode the domestic front node runs Ranch listeners and session/policy
processes; the foreign back node runs mtp_config, DC pools, and downstream
connections.
The key implementation insight: Erlang's transparent distributed process
addressing means `gen_server:call({mtp_dc_pool_1, BackNode}, ...)` works
identically to a local call — zero changes to the hot-path message protocol.
Process monitors fire on node disconnection, so back-node restarts propagate
cleanly to front-node handlers without any watcher process.
Changes:
- mtproto_proxy_sup: role-parameterised children/1
- mtproto_proxy_app: role-gated start, config_changed, port management
- mtp_config: backend_node/0, remote-aware get_downstream_pool/1 and
get_default_dc/0 using erpc:call; get_downstream_safe/2 dispatches
remotely in front mode
- mtp_metric: passive_metrics/0 skips unavailable gauges per role
- split_dc_SUITE: two CT cases (echo, migration) on OTP peer nodes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| bench_codec_decode.erl | ||
| bench_codec_encode.erl | ||
| mtp_prop_gen.erl | ||
| mtp_test_client.erl | ||
| mtp_test_cmd_rpc.erl | ||
| mtp_test_datacenter.erl | ||
| mtp_test_echo_rpc.erl | ||
| mtp_test_metric.erl | ||
| mtp_test_middle_server.erl | ||
| mtp_test_reporter_rpc.erl | ||
| prop_mtp_abridged.erl | ||
| prop_mtp_aes_cbc.erl | ||
| prop_mtp_codec.erl | ||
| prop_mtp_fake_tls.erl | ||
| prop_mtp_full.erl | ||
| prop_mtp_intermediate.erl | ||
| prop_mtp_obfuscated.erl | ||
| prop_mtp_rpc.erl | ||
| prop_mtp_statefull.erl | ||
| single_dc_SUITE.erl | ||
| split_dc_SUITE.erl | ||
| test-sys.config | ||