|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+# This is an example of the configuration file for mtg. You actually can
|
|
|
2
|
+# run mtg with it. It starts a proxy on all interfaces with a secret
|
|
|
3
|
+# ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c65617069732e636f6d
|
|
|
4
|
+#
|
|
|
5
|
+# It has all possible options with default values. So, a real world
|
|
|
6
|
+# configuration file should contain only those options you are going to
|
|
|
7
|
+# use. You do not need to enumerate all of them. In other words, each
|
|
|
8
|
+# option here has a default value. If you comment a key-value pair, it
|
|
|
9
|
+# should not make any effect.
|
|
|
10
|
+#
|
|
|
11
|
+# stats is the only exception.
|
|
|
12
|
+
|
|
|
13
|
+# Debug starts application in debug mode. It starts to be quite verbose
|
|
|
14
|
+# in output. Actually, the idea is that you run it in debug mode only if
|
|
|
15
|
+# you have any issue.
|
|
|
16
|
+debug = false
|
|
|
17
|
+
|
|
|
18
|
+# A secret. Please remember that mtg supports only FakeTLS mode, legacy
|
|
|
19
|
+# simple and secured mode are prohibited. For you it means that secret
|
|
|
20
|
+# should either be base64-encoded or starts with ee.
|
|
|
21
|
+secret = "ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c65617069732e636f6d"
|
|
|
22
|
+
|
|
|
23
|
+# Host:port pair to run proxy on.
|
|
|
24
|
+bind-to = "0.0.0.0:3128"
|
|
|
25
|
+
|
|
|
26
|
+# A size of user-space buffer for TCP to use. Since we do 2 connections,
|
|
|
27
|
+# then we have tcp-buffer * (4 + 2) per each connection: read/write for
|
|
|
28
|
+# each connection + 2 copy buffers to pump the data between sockets.
|
|
|
29
|
+tcp-buffer = "4kb"
|
|
|
30
|
+
|
|
|
31
|
+# Sometimes you want to enforce mtg to use some types of
|
|
|
32
|
+# IP connectivity to Telegram. We have 4 modes:
|
|
|
33
|
+# - prefer-ipv6:
|
|
|
34
|
+# We can use both ipv4 and ipv6 but ipv6 has a preference
|
|
|
35
|
+# - prefer-ipv4:
|
|
|
36
|
+# We can use both ipv4 and ipv6 but ipv4 has a preference
|
|
|
37
|
+# - only-ipv6:
|
|
|
38
|
+# Only ipv6 connectivity is used
|
|
|
39
|
+# - only-ipv4:
|
|
|
40
|
+# Only ipv4 connectivity is used
|
|
|
41
|
+prefer-ips = "prefer-ipv6"
|
|
|
42
|
+
|
|
|
43
|
+# FakeTLS uses domain fronting protection. So it needs to know a port to
|
|
|
44
|
+# access.
|
|
|
45
|
+cloak-port = 443
|
|
|
46
|
+
|
|
|
47
|
+# FakeTLS can compare timestamps to prevent probes. Each message has
|
|
|
48
|
+# encrypted timestamp. So, mtg can compare this timestamp and decide if
|
|
|
49
|
+# we need to proceed with connection or not.
|
|
|
50
|
+#
|
|
|
51
|
+# Please ensure that you have some ntp active on this host. Otherwise,
|
|
|
52
|
+# you can endup with badly performing proxy.
|
|
|
53
|
+[probes.time]
|
|
|
54
|
+# You can enable/disable that. A good idea is always enable.
|
|
|
55
|
+enabled = true
|
|
|
56
|
+# Time can be skewed by many reasons. So, this is a time interval
|
|
|
57
|
+# when message is cosidered as a good one.
|
|
|
58
|
+allow-skewness = "5s"
|
|
|
59
|
+
|
|
|
60
|
+# Some countries do active probing on Telegram connections. This technique
|
|
|
61
|
+# allows to protect from such effort.
|
|
|
62
|
+#
|
|
|
63
|
+# mtg has a cache of some connection fingerprints. Actually, first bytes
|
|
|
64
|
+# of each connection. So, it stores them in some in-memory LRU+TTL cache.
|
|
|
65
|
+# You can configure this cache here.
|
|
|
66
|
+[probes.anti-replay]
|
|
|
67
|
+# You can enable/disable this feature.
|
|
|
68
|
+enabled = true
|
|
|
69
|
+# max size of such a cache. Please be aware that this number is
|
|
|
70
|
+# approximate we try hard to store data quite dense but it is possible
|
|
|
71
|
+# that we can go over this limit for 10-20% under some conditions and
|
|
|
72
|
+# architectures.
|
|
|
73
|
+max-size = "16mb"
|
|
|
74
|
+# TTL for each cache record.
|
|
|
75
|
+ttl = "8h"
|
|
|
76
|
+
|
|
|
77
|
+# public ip addresses of the server. Actually, it is required only to
|
|
|
78
|
+# generate a correct access file. if you use default values here, mtg
|
|
|
79
|
+# will try to resolve these IPs on its own.
|
|
|
80
|
+[public-ip]
|
|
|
81
|
+ipv4 = ""
|
|
|
82
|
+ipv6 = ""
|
|
|
83
|
+
|
|
|
84
|
+# you can redefine a dialer for mtg. Dialer is how we 'dial' to either
|
|
|
85
|
+# some external services or telegram. empty string means default
|
|
|
86
|
+# connectivity.
|
|
|
87
|
+#
|
|
|
88
|
+# it is also possible to use socks5 or shadowsocks here
|
|
|
89
|
+#
|
|
|
90
|
+# socks5 example:
|
|
|
91
|
+# socks5://user:password@host:port
|
|
|
92
|
+# shadowsocks example (SIP002):
|
|
|
93
|
+# ss://YWVzLTEyOC1nY206dGVzdA@192.168.100.1:8888
|
|
|
94
|
+#
|
|
|
95
|
+# You can define 2 dialers here: telegram and default. Telegram dialer
|
|
|
96
|
+# is used to connect to Telegram servers only. Default is used for other
|
|
|
97
|
+# purposes, like accessing ifconfig.co to obtains public address (DNS is
|
|
|
98
|
+# resolved via DoH)
|
|
|
99
|
+#
|
|
|
100
|
+# Please also be aware that dialers are only doing TCP. If UDP is
|
|
|
101
|
+# required (for statsd for example), then these dialers are going to be
|
|
|
102
|
+# ignored.
|
|
|
103
|
+#
|
|
|
104
|
+# If telegram dialer is not defined, a default one is going to be used.
|
|
|
105
|
+[dialers]
|
|
|
106
|
+telegram = ""
|
|
|
107
|
+default = ""
|
|
|
108
|
+
|
|
|
109
|
+# statsd statistics integration.
|
|
|
110
|
+[stats.statsd]
|
|
|
111
|
+# enabled/disabled
|
|
|
112
|
+enabled = false
|
|
|
113
|
+# host:port for UDP endpoint of statsd
|
|
|
114
|
+address = "127.0.0.1:8888"
|
|
|
115
|
+# prefix of metric for statsd
|
|
|
116
|
+metric-prefix = "mtg"
|
|
|
117
|
+
|
|
|
118
|
+# prometheus metrics integration.
|
|
|
119
|
+[stats.prometheus]
|
|
|
120
|
+# enabled/disabled
|
|
|
121
|
+enabled = true
|
|
|
122
|
+# host:port where to start http server for endpoint
|
|
|
123
|
+bind-to = "127.0.0.1:3129"
|
|
|
124
|
+# prefix of http path
|
|
|
125
|
+http-path = "/"
|
|
|
126
|
+# prefix for metrics for prometheus
|
|
|
127
|
+metric-prefix = "mtg"
|