|
|
@@ -206,6 +206,67 @@ tcp = "5s"
|
|
206
|
206
|
http = "10s"
|
|
207
|
207
|
idle = "1m"
|
|
208
|
208
|
|
|
|
209
|
+# mtg has to mimic real websites. It does not mean domain fronting, it also
|
|
|
210
|
+# means that traffic characteristics should be similar to real world traffic.
|
|
|
211
|
+# websites and applications behave differently, their traffic patterns are also
|
|
|
212
|
+# different. Applications do bursts of RPC-style messages (or JSON communication,
|
|
|
213
|
+# does not really matter), while websites pump heavy content in HTTP2 streams
|
|
|
214
|
+#
|
|
|
215
|
+# It means that statistically there is a different between traffic shape:
|
|
|
216
|
+# TLS packet sizes are different, delays between packets are also different.
|
|
|
217
|
+# In order to avoid censorship detection based on these patterns, there is a
|
|
|
218
|
+# mtg subsystem called "Doppelganger" that aims to mimic website statistics
|
|
|
219
|
+# as close as it could.
|
|
|
220
|
+#
|
|
|
221
|
+# It does that by 2 ideas:
|
|
|
222
|
+# 1. Delays between TLS packets are not constant. There are many factors
|
|
|
223
|
+# that come in play. Application should generate some response, it could
|
|
|
224
|
+# send some headers first and stream content with chunked encoding. So
|
|
|
225
|
+# some first packets could come as soon as possible, with some delays
|
|
|
226
|
+# after first ones. Such phenomenon is described by different statistic
|
|
|
227
|
+# distribution. There are 2 distribution that describe it: lognormal
|
|
|
228
|
+# distribution and Weibul distribution. Lognormal is all about steady streams
|
|
|
229
|
+# of heavy content like a video. Weibul is great about short bursts like
|
|
|
230
|
+# user who requested a static page an a couple of images.
|
|
|
231
|
+#
|
|
|
232
|
+# mtg tries to adapt Weibul distribution. It comes with some sensible
|
|
|
233
|
+# defaults that were taken from ok.ru. But when you use domain fronting,
|
|
|
234
|
+# it always make sense to take statistics from that website. You can specify
|
|
|
235
|
+# some urls here. mtg will crawl them from time to time, accumulate time
|
|
|
236
|
+# series and approximates parameters for Weibul.
|
|
|
237
|
+# 2. TLS record sizes are not random.
|
|
|
238
|
+# https://blog.cloudflare.com/optimizing-tls-over-tcp-to-reduce-latency/
|
|
|
239
|
+# https://aws.github.io/s2n-tls/usage-guide/ch08-record-sizes.html
|
|
|
240
|
+#
|
|
|
241
|
+# The idea is that huge TLS records could negatively affect performance.
|
|
|
242
|
+# You cannot simply decrypt a part of the packet, you need to wait it
|
|
|
243
|
+# whole, and huge packets could involve several RTTs if you do not use
|
|
|
244
|
+# any specific software that treat TLS in a very special way. So
|
|
|
245
|
+# servers start with small packets, usually around MTU, and ramp up
|
|
|
246
|
+# later. This optimizes a time-to-first byte so web browsers start to
|
|
|
247
|
+# render early.
|
|
|
248
|
+#
|
|
|
249
|
+# mtg uses the same technique as was introduced by Cloudflare in their
|
|
|
250
|
+# patches to nginx 10 years ago:
|
|
|
251
|
+# https://github.com/cloudflare/sslconfig/blob/master/patches/nginx__dynamic_tls_records.patch
|
|
|
252
|
+[defense.doppelganger]
|
|
|
253
|
+# This is a list of URLs that would be crawled by mtg to approximate delay
|
|
|
254
|
+# statistics. They MUST be HTTPS urls.
|
|
|
255
|
+#
|
|
|
256
|
+# You can come to the website and collect different URLs, with light and
|
|
|
257
|
+# heavy content. We recommend to search for CDNs.
|
|
|
258
|
+urls = [
|
|
|
259
|
+ # "https://st-ok.cdn-vk.ru/res/react/vendor/clsx-2.1.1-amd.js"
|
|
|
260
|
+]
|
|
|
261
|
+# A collection is done in raids. Each raid makes this number of requests to
|
|
|
262
|
+# each URL in this list. Do not use a huge number, 10 is probably ok.
|
|
|
263
|
+repeats-per-raid = 10
|
|
|
264
|
+# This is a duration between each raid. It makes no sense to have a small number
|
|
|
265
|
+# here as you would start to make a noticeable activity. Usually traffic patterns
|
|
|
266
|
+# do not change a lot, so do not expect different results if you request
|
|
|
267
|
+# each 10 minutes.
|
|
|
268
|
+raid-each = "6h"
|
|
|
269
|
+
|
|
209
|
270
|
# Some countries do active probing on Telegram connections. This technique
|
|
210
|
271
|
# allows to protect from such effort.
|
|
211
|
272
|
#
|