Update configuration file with proxies specification

This commit is contained in:
9seconds
2021-03-10 11:12:10 +03:00
parent f89f5f8469
commit e0833e86d9
2 changed files with 44 additions and 8 deletions
+35
View File
@@ -60,6 +60,41 @@ cloak-port = 443
# By default we use Quad9. # By default we use Quad9.
doh-hostname = "9.9.9.9" doh-hostname = "9.9.9.9"
# mtg can work via proxies (for now, we support only socks5). Proxy
# configuration is done via list. So, you can specify many proxies
# there.
#
# Actually, if you supply an empty list, then no proxies are going to be
# used. If you supply a single proxy, then mtg will use it exclusively.
# If you supply >= 2, then mtg will load balance between them.
#
# If you add an empty string here, this is an equivalent of 'plain network',
# with no proxy usage.
#
# Proxy configuration is done via ordinary URI schema:
#
# socks5://user:password@host:port?open_threshold=5&half_open_timeout=1m&reset_failures_timeout=10s
#
# Only socks5 proxy is used. user/password is optional. As you can
# see, you can specify some parameters in GET query. These parameters
# configure circuit breaker.
#
# open_threshold means a number of errors which should happen so we stop
# use a proxy.
#
# half_open_timeout means a time period (in Golang duration notation)
# after which we can retry with this proxy
#
# reset_failures_timeout means a time period when we flush out errors
# when circuit breaker in closed state.
#
# Please see https://docs.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker
# on details about circuit breakers.
proxies = [
# "socks5://user:password@host:port?open_threshold=5&half_open_timeout=1m&reset_failures_timeout=10s"
]
# public ip addresses of the server. Actually, it is required only to # public ip addresses of the server. Actually, it is required only to
# generate a correct access file. if you use default values here, mtg # generate a correct access file. if you use default values here, mtg
# will try to resolve these IPs on its own. # will try to resolve these IPs on its own.
+9 -8
View File
@@ -8,13 +8,13 @@ import (
) )
type rawConfig struct { type rawConfig struct {
Debug bool `toml:"debug"` Debug bool `toml:"debug"`
Secret string `toml:"secret"` Secret string `toml:"secret"`
BindTo string `toml:"bind-to"` BindTo string `toml:"bind-to"`
TCPBuffer string `toml:"tcp-buffer"` TCPBuffer string `toml:"tcp-buffer"`
PreferIP string `toml:"prefer-ip"` PreferIP string `toml:"prefer-ip"`
CloakPort uint `toml:"cloak-port"` CloakPort uint `toml:"cloak-port"`
Probes struct { Probes struct {
Time struct { Time struct {
Enabled bool `toml:"enabled"` Enabled bool `toml:"enabled"`
AllowSkewness string `toml:"allow-skewness"` AllowSkewness string `toml:"allow-skewness"`
@@ -34,7 +34,8 @@ type rawConfig struct {
Telegram string `toml:"telegram"` Telegram string `toml:"telegram"`
Default string `toml:"default"` Default string `toml:"default"`
} `toml:"dialers"` } `toml:"dialers"`
DOHHostname string `toml:"doh-hostname"` DOHHostname string `toml:"doh-hostname"`
Proxies []string `toml:"proxies"`
} `toml:"network"` } `toml:"network"`
Stats struct { Stats struct {
StatsD struct { StatsD struct {