mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 19:04:02 +03:00
Add concurrency parameter
This commit is contained in:
+16
-14
@@ -10,13 +10,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Debug bool `json:"debug"`
|
Debug bool `json:"debug"`
|
||||||
Secret mtglib.Secret `json:"secret"`
|
Secret mtglib.Secret `json:"secret"`
|
||||||
BindTo TypeHostPort `json:"bind-to"`
|
BindTo TypeHostPort `json:"bind-to"`
|
||||||
TCPBuffer TypeBytes `json:"tcp-buffer"`
|
TCPBuffer TypeBytes `json:"tcp-buffer"`
|
||||||
PreferIP TypePreferIP `json:"prefer-ip"`
|
PreferIP TypePreferIP `json:"prefer-ip"`
|
||||||
CloakPort TypePort `json:"cloak-port"`
|
CloakPort TypePort `json:"cloak-port"`
|
||||||
Defense struct {
|
Concurrency uint `json:"concurrency"`
|
||||||
|
Defense struct {
|
||||||
Time struct {
|
Time struct {
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
AllowSkewness TypeDuration `json:"allow-skewness"`
|
AllowSkewness TypeDuration `json:"allow-skewness"`
|
||||||
@@ -80,13 +81,14 @@ func (c *Config) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type configRaw struct {
|
type configRaw struct {
|
||||||
Debug bool `toml:"debug" json:"debug,omitempty"`
|
Debug bool `toml:"debug" json:"debug,omitempty"`
|
||||||
Secret string `toml:"secret" json:"secret"`
|
Secret string `toml:"secret" json:"secret"`
|
||||||
BindTo string `toml:"bind-to" json:"bind-to"`
|
BindTo string `toml:"bind-to" json:"bind-to"`
|
||||||
TCPBuffer string `toml:"tcp-buffer" json:"tcp-buffer,omitempty"`
|
TCPBuffer string `toml:"tcp-buffer" json:"tcp-buffer,omitempty"`
|
||||||
PreferIP string `toml:"prefer-ip" json:"prefer-ip,omitempty"`
|
PreferIP string `toml:"prefer-ip" json:"prefer-ip,omitempty"`
|
||||||
CloakPort uint `toml:"cloak-port" json:"cloak-port,omitempty"`
|
CloakPort uint `toml:"cloak-port" json:"cloak-port,omitempty"`
|
||||||
Defense struct {
|
Concurrency uint `toml:"concurrency" json:"concurrency,omitempty"`
|
||||||
|
Defense struct {
|
||||||
Time struct {
|
Time struct {
|
||||||
Enabled bool `toml:"enabled" json:"enabled,omitempty"`
|
Enabled bool `toml:"enabled" json:"enabled,omitempty"`
|
||||||
AllowSkewness string `toml:"allow-skewness" json:"allow-skewness,omitempty"`
|
AllowSkewness string `toml:"allow-skewness" json:"allow-skewness,omitempty"`
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ secret = "ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c6561706973
|
|||||||
# Host:port pair to run proxy on.
|
# Host:port pair to run proxy on.
|
||||||
bind-to = "0.0.0.0:3128"
|
bind-to = "0.0.0.0:3128"
|
||||||
|
|
||||||
|
# Defines how many concurrent connections are allowed to this proxy.
|
||||||
|
# All other incoming connections are going to be dropped.
|
||||||
|
concurrency = 8192
|
||||||
|
|
||||||
# A size of user-space buffer for TCP to use. Since we do 2 connections,
|
# A size of user-space buffer for TCP to use. Since we do 2 connections,
|
||||||
# then we have tcp-buffer * (4 + 2) per each connection: read/write for
|
# then we have tcp-buffer * (4 + 2) per each connection: read/write for
|
||||||
# each connection + 2 copy buffers to pump the data between sockets.
|
# each connection + 2 copy buffers to pump the data between sockets.
|
||||||
|
|||||||
Reference in New Issue
Block a user