mirror of
https://github.com/seriyps/mtproto_proxy.git
synced 2026-08-04 15:19:47 +00:00
README fixed and updated
This commit is contained in:
parent
d5d8b0d98e
commit
42eb63f29b
1 changed files with 19 additions and 11 deletions
30
README.md
30
README.md
|
|
@ -18,7 +18,7 @@ Features
|
|||
* Protection from [replay attacks](https://habr.com/ru/post/452144/) used to detect proxies in some countries
|
||||
* Automatic telegram configuration reload (no need for restarts once per day)
|
||||
* Most of the configuration options can be updated without service restart
|
||||
* Small codebase compared to official one
|
||||
* Small codebase compared to official one, code is covered by automated tests
|
||||
* A lots of metrics could be exported (optional)
|
||||
|
||||
How to start - docker
|
||||
|
|
@ -36,7 +36,7 @@ docker run -d --network=host seriyps/mtproto-proxy
|
|||
docker run -d --network=host seriyps/mtproto-proxy -p 443 -s d0d6e111bada5511fcce9584deadbeef -t dcbe8f1493fa4cd9ab300891c0b5b326
|
||||
```
|
||||
|
||||
or via environmet variables
|
||||
or via environment variables
|
||||
|
||||
```bash
|
||||
docker run -d --network=host -e MTP_PORT=443 -e MTP_SECRET=d0d6e111bada5511fcce9584deadbeef -e MTP_TAG=dcbe8f1493fa4cd9ab300891c0b5b326 seriyps/mtproto-proxy
|
||||
|
|
@ -64,6 +64,8 @@ your server's OS (see below).
|
|||
How to start OS-install - quick
|
||||
-----------------------------------
|
||||
|
||||
You need at least Erlang version 20! Recommended OS is Ubuntu 18.04.
|
||||
|
||||
```bash
|
||||
sudo apt install erlang-nox erlang-dev build-essential
|
||||
git clone https://github.com/seriyps/mtproto_proxy.git
|
||||
|
|
@ -159,15 +161,15 @@ Logs can be found at
|
|||
Settings
|
||||
--------
|
||||
|
||||
All possible documanted configuration options could be found
|
||||
in `src/mtproto_proxy.app.src`. Do not edit this file!
|
||||
All available documented configuration options could be found
|
||||
in [src/mtproto_proxy.app.src](src/mtproto_proxy.app.src). Do not edit this file!
|
||||
|
||||
To change configuration, edit `config/prod-sys.config`:
|
||||
|
||||
Comments in this file start from `%%`.
|
||||
Comments in this file start with `%%`.
|
||||
Default port is 1443 and default secret is `d0d6e111bada5511fcce9584deadbeef`.
|
||||
|
||||
Secret key and proxy URL will be printed on start.
|
||||
Secret key and proxy URLs will be printed on start.
|
||||
|
||||
The easiest way to update config right now is to edit `config/prod-sys.config`
|
||||
and then re-install proxy by
|
||||
|
|
@ -186,7 +188,6 @@ To change default settings, change `mtproto_proxy` section of `prod-sys.config`
|
|||
```erlang
|
||||
{mtproto_proxy,
|
||||
%% see src/mtproto_proxy.app.src for examples.
|
||||
%% DO NOT EDIT src/mtproto_proxy.app.src!!!
|
||||
[
|
||||
{ports,
|
||||
[#{name => mtp_handler1,
|
||||
|
|
@ -210,7 +211,6 @@ To do so, just add more configs to `ports` section, separated by comma, eg:
|
|||
```erlang
|
||||
{mtproto_proxy,
|
||||
%% see src/mtproto_proxy.app.src for examples.
|
||||
%% DO NOT EDIT src/mtproto_proxy.app.src!!!
|
||||
[
|
||||
{ports,
|
||||
[#{name => mtp_handler_1,
|
||||
|
|
@ -253,19 +253,20 @@ If your server have low amount of RAM, try to set
|
|||
```erlang
|
||||
{upstream_socket_buffer_size, 5120},
|
||||
{downstream_socket_buffer_size, 51200},
|
||||
{replay_checks_enabled, []},
|
||||
{replay_check_session_storage, off},
|
||||
```
|
||||
|
||||
this may make proxy slower, it can start consume more CPU, will be vulnerable to replay attacks,
|
||||
this may make proxy slower, it can start to consume bit more CPU, will be vulnerable to replay attacks,
|
||||
but will use less RAM.
|
||||
|
||||
If your server have lots of RAM, you can make it faster (users will get higher uppload/download speed),
|
||||
it will use less CPU and will be better protected from replay attacks, but will use more RAM:
|
||||
|
||||
```erlang
|
||||
{max_connections, 128000},
|
||||
{upstream_socket_buffer_size, 20480},
|
||||
{downstream_socket_buffer_size, 512000},
|
||||
{replay_checks_enabled, [mtp_session_storage]},
|
||||
{replay_check_session_storage, on},
|
||||
{replay_check_session_storage_opts,
|
||||
#{max_memory_mb => 2048,
|
||||
max_age_minutes => 1440}},
|
||||
|
|
@ -281,6 +282,13 @@ sudo sysctl 'net.ipv4.tcp_mem=179200 256000 384000'
|
|||
Values for `tcp_mem` are in pages. Size of one page can be found by `getconf PAGESIZE` and is most
|
||||
likely 4kb.
|
||||
|
||||
If you have installed proxy via Docker or use some NAT firewall settings, you may want to increase
|
||||
netfilter conntrack limits to be at least the max number of connections you expect:
|
||||
|
||||
```
|
||||
sudo sysctl net.netfilter.nf_conntrack_max=128000
|
||||
```
|
||||
|
||||
|
||||
Helpers
|
||||
-------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue