mirror of https://github.com/telemt/telemt.git
Compare commits
No commits in common. "95c130616699e34d8ddab97c93f0d9b3bde57c25" and "4d8a5ca174c4b0b42352b3edbe1d257b0fd37578" have entirely different histories.
95c1306166
...
4d8a5ca174
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "telemt"
|
name = "telemt"
|
||||||
version = "3.3.19"
|
version = "3.3.18"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -83,13 +83,6 @@ To specify a domain in the links, add to the `[general.links]` section of the co
|
||||||
public_host = "proxy.example.com"
|
public_host = "proxy.example.com"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Server connection limit
|
|
||||||
Limits the total number of open connections to the server:
|
|
||||||
```toml
|
|
||||||
[server]
|
|
||||||
max_connections = 10000 # 0 - unlimited, 10000 - default
|
|
||||||
```
|
|
||||||
|
|
||||||
### Upstream Manager
|
### Upstream Manager
|
||||||
To specify an upstream, add to the `[[upstreams]]` section of the config.toml file:
|
To specify an upstream, add to the `[[upstreams]]` section of the config.toml file:
|
||||||
#### Binding to IP
|
#### Binding to IP
|
||||||
|
|
|
||||||
|
|
@ -83,13 +83,6 @@ metrics_whitelist = ["127.0.0.1/32", "::1/128", "0.0.0.0/0"]
|
||||||
public_host = "proxy.example.com"
|
public_host = "proxy.example.com"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Общий лимит подключений к серверу
|
|
||||||
Ограничивает общее число открытых подключений к серверу:
|
|
||||||
```toml
|
|
||||||
[server]
|
|
||||||
max_connections = 10000 # 0 - unlimited, 10000 - default
|
|
||||||
```
|
|
||||||
|
|
||||||
### Upstream Manager
|
### Upstream Manager
|
||||||
Чтобы указать апстрим, добавьте в секцию `[[upstreams]]` файла config.toml:
|
Чтобы указать апстрим, добавьте в секцию `[[upstreams]]` файла config.toml:
|
||||||
#### Привязка к IP
|
#### Привязка к IP
|
||||||
|
|
@ -120,4 +113,3 @@ password = "pass" # Password for Auth on SOCKS-server
|
||||||
weight = 1 # Set Weight for Scenarios
|
weight = 1 # Set Weight for Scenarios
|
||||||
enabled = true
|
enabled = true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,10 +147,6 @@ pub(crate) fn default_proxy_protocol_header_timeout_ms() -> u64 {
|
||||||
500
|
500
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn default_server_max_connections() -> u32 {
|
|
||||||
10_000
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn default_prefer_4() -> u8 {
|
pub(crate) fn default_prefer_4() -> u8 {
|
||||||
4
|
4
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1167,11 +1167,6 @@ pub struct ServerConfig {
|
||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub listeners: Vec<ListenerConfig>,
|
pub listeners: Vec<ListenerConfig>,
|
||||||
|
|
||||||
/// Maximum number of concurrent client connections.
|
|
||||||
/// 0 means unlimited.
|
|
||||||
#[serde(default = "default_server_max_connections")]
|
|
||||||
pub max_connections: u32,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ServerConfig {
|
impl Default for ServerConfig {
|
||||||
|
|
@ -1189,7 +1184,6 @@ impl Default for ServerConfig {
|
||||||
metrics_whitelist: default_metrics_whitelist(),
|
metrics_whitelist: default_metrics_whitelist(),
|
||||||
api: ApiConfig::default(),
|
api: ApiConfig::default(),
|
||||||
listeners: Vec::new(),
|
listeners: Vec::new(),
|
||||||
max_connections: default_server_max_connections(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -349,13 +349,8 @@ pub async fn run() -> std::result::Result<(), Box<dyn std::error::Error>> {
|
||||||
let beobachten = Arc::new(BeobachtenStore::new());
|
let beobachten = Arc::new(BeobachtenStore::new());
|
||||||
let rng = Arc::new(SecureRandom::new());
|
let rng = Arc::new(SecureRandom::new());
|
||||||
|
|
||||||
// Connection concurrency limit (0 = unlimited)
|
// Connection concurrency limit
|
||||||
let max_connections_limit = if config.server.max_connections == 0 {
|
let max_connections = Arc::new(Semaphore::new(10_000));
|
||||||
Semaphore::MAX_PERMITS
|
|
||||||
} else {
|
|
||||||
config.server.max_connections as usize
|
|
||||||
};
|
|
||||||
let max_connections = Arc::new(Semaphore::new(max_connections_limit));
|
|
||||||
|
|
||||||
let me2dc_fallback = config.general.me2dc_fallback;
|
let me2dc_fallback = config.general.me2dc_fallback;
|
||||||
let me_init_retry_attempts = config.general.me_init_retry_attempts;
|
let me_init_retry_attempts = config.general.me_init_retry_attempts;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue