diff --git a/.claude/commands/reflection.md b/.claude/commands/reflection.md
new file mode 100644
index 000000000..9628fc157
--- /dev/null
+++ b/.claude/commands/reflection.md
@@ -0,0 +1,56 @@
+You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code.
+Follow these steps carefully:
+
+1. Analysis Phase:
+Review the chat history in your context window.
+
+Then, examine the current Claude instructions, commands and config
+
+/CLAUDE.md
+/.claude/commands/*
+**/CLAUDE.md
+.claude/settings.json
+.claude/settings.local.json
+
+
+Analyze the chat history, instructions, commands and config to identify areas that could be improved. Look for:
+- Inconsistencies in Claude's responses
+- Misunderstandings of user requests
+- Areas where Claude could provide more detailed or accurate information
+- Opportunities to enhance Claude's ability to handle specific types of queries or tasks
+- New commands or improvements to a commands name, function or response
+- Permissions and MCPs we've approved locally that we should add to the config, especially if we've added new tools or require them for the command to work
+
+2. Interaction Phase:
+Present your findings and improvement ideas to the human. For each suggestion:
+a) Explain the current issue you've identified
+b) Propose a specific change or addition to the instructions
+c) Describe how this change would improve Claude's performance
+
+Wait for feedback from the human on each suggestion before proceeding. If the human approves a change, move it to the implementation phase. If not, refine your suggestion or move on to the next idea.
+
+3. Implementation Phase:
+For each approved change:
+a) Clearly state the section of the instructions you're modifying
+b) Present the new or modified text for that section
+c) Explain how this change addresses the issue identified in the analysis phase
+
+4. Output Format:
+Present your final output in the following structure:
+
+
+[List the issues identified and potential improvements]
+
+
+
+[For each approved improvement:
+1. Section being modified
+2. New or modified instruction text
+3. Explanation of how this addresses the identified issue]
+
+
+
+[Present the complete, updated set of instructions for Claude, incorporating all approved changes]
+
+
+Remember, your goal is to enhance Claude's performance and consistency while maintaining the core functionality and purpose of the AI assistant. Be thorough in your analysis, clear in your explanations, and precise in your implementations.
\ No newline at end of file
diff --git a/CLAUDE.md b/CLAUDE.md
index 9bdb7c8cc..8d46e1fa1 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -82,3 +82,10 @@ When working with files, ignore these directories:
- `flutter` - Enable Flutter UI
- `unix-file-copy-paste` - Unix file clipboard support
- `screencapturekit` - macOS ScreenCaptureKit (macOS only)
+
+### Config
+All configurations or options are under `libs/hbb_common/src/config.rs` file, 4 types:
+- Settings
+- Local
+- Display
+- Built-in
diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart
index a1dbb4ec8..a3063d9c7 100644
--- a/flutter/lib/consts.dart
+++ b/flutter/lib/consts.dart
@@ -147,6 +147,8 @@ const String kOptionAllowRemoveWallpaper = "allow-remove-wallpaper";
const String kOptionStopService = "stop-service";
const String kOptionDirectxCapture = "enable-directx-capture";
const String kOptionAllowRemoteCmModification = "allow-remote-cm-modification";
+const String kOptionEnableUdpPunch = "enable-udp-punch";
+const String kOptionEnableIpv6Punch = "enable-ipv6-punch";
const String kOptionEnableTrustedDevices = "enable-trusted-devices";
// network options
diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart
index 688fdf3b9..455ab6c11 100644
--- a/flutter/lib/desktop/pages/desktop_setting_page.dart
+++ b/flutter/lib/desktop/pages/desktop_setting_page.dart
@@ -540,6 +540,20 @@ class _GeneralState extends State<_General> {
'Capture screen using DirectX',
kOptionDirectxCapture,
),
+ if (!bind.isIncomingOnly()) ...[
+ _OptionCheckBox(
+ context,
+ 'Enable UDP hole punching',
+ kOptionEnableUdpPunch,
+ isServer: false,
+ ),
+ _OptionCheckBox(
+ context,
+ 'Enable IPv6 P2P connection',
+ kOptionEnableIpv6Punch,
+ isServer: false,
+ ),
+ ],
],
];
if (!isWeb && bind.mainShowOption(key: kOptionAllowLinuxHeadless)) {
diff --git a/flutter/lib/mobile/pages/settings_page.dart b/flutter/lib/mobile/pages/settings_page.dart
index 73aabc2e2..693bdbd30 100644
--- a/flutter/lib/mobile/pages/settings_page.dart
+++ b/flutter/lib/mobile/pages/settings_page.dart
@@ -5,7 +5,6 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common/widgets/setting_widgets.dart';
import 'package:flutter_hbb/desktop/pages/desktop_setting_page.dart';
-import 'package:flutter_hbb/models/state_model.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:settings_ui/settings_ui.dart';
@@ -94,6 +93,8 @@ class _SettingsState extends State with WidgetsBindingObserver {
var _hideNetwork = false;
var _hideWebSocket = false;
var _enableTrustedDevices = false;
+ var _enableUdpPunch = false;
+ var _enableIpv6Punch = false;
_SettingsState() {
_enableAbr = option2bool(
@@ -124,8 +125,11 @@ class _SettingsState extends State with WidgetsBindingObserver {
_hideNetwork =
bind.mainGetBuildinOption(key: kOptionHideNetworkSetting) == 'Y';
_hideWebSocket =
- bind.mainGetBuildinOption(key: kOptionHideWebSocketSetting) == 'Y' || isWeb;
+ bind.mainGetBuildinOption(key: kOptionHideWebSocketSetting) == 'Y' ||
+ isWeb;
_enableTrustedDevices = mainGetBoolOptionSync(kOptionEnableTrustedDevices);
+ _enableUdpPunch = mainGetLocalBoolOptionSync(kOptionEnableUdpPunch);
+ _enableIpv6Punch = mainGetLocalBoolOptionSync(kOptionEnableIpv6Punch);
}
@override
@@ -687,6 +691,32 @@ class _SettingsState extends State with WidgetsBindingObserver {
});
},
),
+ if (!incomingOnly)
+ SettingsTile.switchTile(
+ title: Text(translate('Enable UDP hole punching')),
+ initialValue: _enableUdpPunch,
+ onToggle: (v) async {
+ await mainSetLocalBoolOption(kOptionEnableUdpPunch, v);
+ final newValue =
+ mainGetLocalBoolOptionSync(kOptionEnableUdpPunch);
+ setState(() {
+ _enableUdpPunch = newValue;
+ });
+ },
+ ),
+ if (!incomingOnly)
+ SettingsTile.switchTile(
+ title: Text(translate('Enable IPv6 P2P connection')),
+ initialValue: _enableIpv6Punch,
+ onToggle: (v) async {
+ await mainSetLocalBoolOption(kOptionEnableIpv6Punch, v);
+ final newValue =
+ mainGetLocalBoolOptionSync(kOptionEnableIpv6Punch);
+ setState(() {
+ _enableIpv6Punch = newValue;
+ });
+ },
+ ),
SettingsTile(
title: Text(translate('Language')),
leading: Icon(Icons.translate),
diff --git a/libs/hbb_common b/libs/hbb_common
index 78facdf75..92ca2ca8b 160000
--- a/libs/hbb_common
+++ b/libs/hbb_common
@@ -1 +1 @@
-Subproject commit 78facdf7597981b7e937985daa87400da07d7183
+Subproject commit 92ca2ca8be6c54d3977e35292d378dfbe90908fc
diff --git a/src/client.rs b/src/client.rs
index a35db71c5..a3bcd732b 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -274,21 +274,28 @@ impl Client {
}
};
- crate::test_ipv6().await;
+
+ if crate::get_ipv6_punch_enabled() {
+ crate::test_ipv6().await;
+ }
let (stop_udp_tx, stop_udp_rx) = oneshot::channel::<()>();
let mut udp =
// no need to care about multiple rendezvous servers case, since it is acutally not used any more.
// Shared state for UDP NAT test result
- if let Ok((socket, addr)) = new_direct_udp_for(&rendezvous_server).await {
- let udp_port = Arc::new(Mutex::new(0));
- let up_cloned = udp_port.clone();
- let socket_cloned = socket.clone();
- let func = async move {
- allow_err!(test_udp_uat(socket_cloned, addr, up_cloned, stop_udp_rx).await);
- };
- tokio::spawn(func);
- (Some(socket), Some(udp_port))
+ if crate::get_udp_punch_enabled() {
+ if let Ok((socket, addr)) = new_direct_udp_for(&rendezvous_server).await {
+ let udp_port = Arc::new(Mutex::new(0));
+ let up_cloned = udp_port.clone();
+ let socket_cloned = socket.clone();
+ let func = async move {
+ allow_err!(test_udp_uat(socket_cloned, addr, up_cloned, stop_udp_rx).await);
+ };
+ tokio::spawn(func);
+ (Some(socket), Some(udp_port))
+ } else {
+ (None, None)
+ }
} else {
(None, None)
};
@@ -351,8 +358,12 @@ impl Client {
// Stop UDP NAT test task if still running
let _ = stop_udp_tx.send(());
let mut msg_out = RendezvousMessage::new();
- let mut ipv6 = if let Some((socket, addr)) = crate::get_ipv6_socket().await {
- (Some(socket), Some(addr))
+ let mut ipv6 = if crate::get_ipv6_punch_enabled() {
+ if let Some((socket, addr)) = crate::get_ipv6_socket().await {
+ (Some(socket), Some(addr))
+ } else {
+ (None, None)
+ }
} else {
(None, None)
};
@@ -3778,7 +3789,7 @@ pub mod peer_online {
}
// Retry for 2 times to get the online response
for _ in 0..2 {
- if let Some(msg_in) = crate::common::get_next_nonkeyexchange_msg(
+ if let Some(msg_in) = crate::get_next_nonkeyexchange_msg(
&mut socket,
Some(timeout.as_millis() as _),
)
diff --git a/src/common.rs b/src/common.rs
index 9c86186d1..c4e43e569 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -6,7 +6,6 @@ use std::{
task::Poll,
};
-use default_net::ip;
use serde_json::{json, Map, Value};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
@@ -16,7 +15,9 @@ use hbb_common::{
anyhow::{anyhow, Context},
bail, base64,
bytes::Bytes,
- config::{self, use_ws, Config, CONNECT_TIMEOUT, READ_TIMEOUT, RENDEZVOUS_PORT},
+ config::{
+ self, keys, use_ws, Config, LocalConfig, CONNECT_TIMEOUT, READ_TIMEOUT, RENDEZVOUS_PORT,
+ },
futures::future::join_all,
futures_util::future::poll_fn,
get_version_number, log,
@@ -881,8 +882,8 @@ pub fn check_software_update() {
if is_custom_client() {
return;
}
- let opt = config::LocalConfig::get_option(config::keys::OPTION_ENABLE_CHECK_UPDATE);
- if config::option2bool(config::keys::OPTION_ENABLE_CHECK_UPDATE, &opt) {
+ let opt = LocalConfig::get_option(keys::OPTION_ENABLE_CHECK_UPDATE);
+ if config::option2bool(keys::OPTION_ENABLE_CHECK_UPDATE, &opt) {
std::thread::spawn(move || allow_err!(do_check_software_update()));
}
}
@@ -973,7 +974,7 @@ pub fn get_api_server(api: String, custom: String) -> String {
}
if res.starts_with("https")
&& res.ends_with(":21114")
- && get_builtin_option(config::keys::OPTION_ALLOW_HTTPS_21114) != "Y"
+ && get_builtin_option(keys::OPTION_ALLOW_HTTPS_21114) != "Y"
{
return res.replace(":21114", "");
}
@@ -1011,6 +1012,32 @@ pub fn is_public(url: &str) -> bool {
url.contains("rustdesk.com")
}
+pub fn get_udp_punch_enabled() -> bool {
+ config::option2bool(
+ keys::OPTION_ENABLE_UDP_PUNCH,
+ &get_local_option(keys::OPTION_ENABLE_UDP_PUNCH),
+ )
+}
+
+pub fn get_ipv6_punch_enabled() -> bool {
+ config::option2bool(
+ keys::OPTION_ENABLE_IPV6_PUNCH,
+ &get_local_option(keys::OPTION_ENABLE_IPV6_PUNCH),
+ )
+}
+
+pub fn get_local_option(key: &str) -> String {
+ let v = LocalConfig::get_option(key);
+ if key == keys::OPTION_ENABLE_UDP_PUNCH || key == keys::OPTION_ENABLE_IPV6_PUNCH {
+ if v.is_empty() {
+ if !is_public(&Config::get_rendezvous_server()) {
+ return "N".to_owned();
+ }
+ }
+ }
+ v
+}
+
pub fn get_audit_server(api: String, custom: String, typ: String) -> String {
let url = get_api_server(api, custom);
if url.is_empty() || is_public(&url) {
@@ -1618,19 +1645,19 @@ pub fn read_custom_client(config: &str) {
}
let mut map_display_settings = HashMap::new();
- for s in config::keys::KEYS_DISPLAY_SETTINGS {
+ for s in keys::KEYS_DISPLAY_SETTINGS {
map_display_settings.insert(s.replace("_", "-"), s);
}
let mut map_local_settings = HashMap::new();
- for s in config::keys::KEYS_LOCAL_SETTINGS {
+ for s in keys::KEYS_LOCAL_SETTINGS {
map_local_settings.insert(s.replace("_", "-"), s);
}
let mut map_settings = HashMap::new();
- for s in config::keys::KEYS_SETTINGS {
+ for s in keys::KEYS_SETTINGS {
map_settings.insert(s.replace("_", "-"), s);
}
let mut buildin_settings = HashMap::new();
- for s in config::keys::KEYS_BUILDIN_SETTINGS {
+ for s in keys::KEYS_BUILDIN_SETTINGS {
buildin_settings.insert(s.replace("_", "-"), s);
}
if let Some(default_settings) = data.remove("default-settings") {
@@ -1725,7 +1752,7 @@ pub fn verify_login(raw: &str, id: &str) -> bool {
#[inline]
pub fn is_udp_disabled() -> bool {
- get_builtin_option(config::keys::OPTION_DISABLE_UDP) == "Y"
+ get_builtin_option(keys::OPTION_DISABLE_UDP) == "Y"
}
// this crate https://github.com/yoshd/stun-client supports nat type
diff --git a/src/lang/ar.rs b/src/lang/ar.rs
index 1bd01ad9e..a337e5f20 100644
--- a/src/lang/ar.rs
+++ b/src/lang/ar.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "سرعة لوحة التتبع"),
("Default trackpad speed", "سرعة لوحة التتبع الافتراضية"),
("Numeric one-time password", "كلمة مرور رقمية لمرة واحدة"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/be.rs b/src/lang/be.rs
index f68d10f89..3f3a9310d 100644
--- a/src/lang/be.rs
+++ b/src/lang/be.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/bg.rs b/src/lang/bg.rs
index aeb1949ba..7b479481f 100644
--- a/src/lang/bg.rs
+++ b/src/lang/bg.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ca.rs b/src/lang/ca.rs
index 8abc42722..bd15d2c48 100644
--- a/src/lang/ca.rs
+++ b/src/lang/ca.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/cn.rs b/src/lang/cn.rs
index 4fa80d7be..a4f7d09d2 100644
--- a/src/lang/cn.rs
+++ b/src/lang/cn.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "触控板速度"),
("Default trackpad speed", "默认触控板速度"),
("Numeric one-time password", "一次性密码为数字"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/cs.rs b/src/lang/cs.rs
index f3a89ed5b..b4a903b86 100644
--- a/src/lang/cs.rs
+++ b/src/lang/cs.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/da.rs b/src/lang/da.rs
index 693f3e27e..2bd617276 100644
--- a/src/lang/da.rs
+++ b/src/lang/da.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/de.rs b/src/lang/de.rs
index 23fcbfdd9..3ba356e1c 100644
--- a/src/lang/de.rs
+++ b/src/lang/de.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Geschwindigkeit des Trackpads"),
("Default trackpad speed", "Standardgeschwindigkeit des Trackpads"),
("Numeric one-time password", "Numerisches Einmalpasswort"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/el.rs b/src/lang/el.rs
index 84bb740f2..464585593 100644
--- a/src/lang/el.rs
+++ b/src/lang/el.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/eo.rs b/src/lang/eo.rs
index e8ee586ee..25e2a5ec7 100644
--- a/src/lang/eo.rs
+++ b/src/lang/eo.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/es.rs b/src/lang/es.rs
index 207b4004f..847bfd447 100644
--- a/src/lang/es.rs
+++ b/src/lang/es.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Velocidad de trackpad"),
("Default trackpad speed", "Velocidad predeterminada de trackpad"),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/et.rs b/src/lang/et.rs
index 1b8d7cd53..eff5c6d9e 100644
--- a/src/lang/et.rs
+++ b/src/lang/et.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/eu.rs b/src/lang/eu.rs
index 26b7d0a76..24eac0460 100644
--- a/src/lang/eu.rs
+++ b/src/lang/eu.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/fa.rs b/src/lang/fa.rs
index f4dc64b62..093dc6f66 100644
--- a/src/lang/fa.rs
+++ b/src/lang/fa.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "سرعت ترکپد"),
("Default trackpad speed", "سرعت پیشفرض ترکپد"),
("Numeric one-time password", "رمز عبور یکبار مصرف عددی"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/fr.rs b/src/lang/fr.rs
index 34e2cc263..ce4af5ac1 100644
--- a/src/lang/fr.rs
+++ b/src/lang/fr.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Vitesse du pavé tactile"),
("Default trackpad speed", "Vitesse par défaut du pavé tactile"),
("Numeric one-time password", "Mot de passe à usage unique numérique"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ge.rs b/src/lang/ge.rs
index 8f19d5d0f..d8668c27f 100644
--- a/src/lang/ge.rs
+++ b/src/lang/ge.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/he.rs b/src/lang/he.rs
index 249e53e97..3f051cf8b 100644
--- a/src/lang/he.rs
+++ b/src/lang/he.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "מהירות משטח מגע"),
("Default trackpad speed", "מהירות ברירת מחדל של משטח מגע"),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/hr.rs b/src/lang/hr.rs
index 1aed86277..9dd074b26 100644
--- a/src/lang/hr.rs
+++ b/src/lang/hr.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/hu.rs b/src/lang/hu.rs
index 30cdb493b..4c356c0d1 100644
--- a/src/lang/hu.rs
+++ b/src/lang/hu.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Érintőpad sebessége"),
("Default trackpad speed", "Alapértelmezett érintőpad sebessége"),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/id.rs b/src/lang/id.rs
index f1d321582..245a1562a 100644
--- a/src/lang/id.rs
+++ b/src/lang/id.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/it.rs b/src/lang/it.rs
index badab5606..fdea76c36 100644
--- a/src/lang/it.rs
+++ b/src/lang/it.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Velocità trackpad"),
("Default trackpad speed", "Velocità predefinita trackpad"),
("Numeric one-time password", "Password numerica monouso"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ja.rs b/src/lang/ja.rs
index 420695da7..b2c57d06e 100644
--- a/src/lang/ja.rs
+++ b/src/lang/ja.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ko.rs b/src/lang/ko.rs
index f169ce49d..195f83721 100644
--- a/src/lang/ko.rs
+++ b/src/lang/ko.rs
@@ -690,7 +690,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable remote printer", "원격 프린터 활성화"),
("Downloading {}", "{} 다운로드 중"),
("{} Update", "{} 업데이트"),
- ("update_to_{}_tip", "{} 버전으로 업데이트합니다. 프로그램 종료 후 새 버전이 설치됩니다."),
+ ("{}-to-update-tip", ""),
("download-new-version-failed-tip", "다운로드에 실패했습니다. 다시 시도하거나 '다운로드' 버튼을 클릭하여 릴리스 페이지에서 직접 다운로드한 후 수동으로 업그레이드하십시오."),
("Auto update", "자동 업데이트"),
("update-failed-check-msi-tip", "설치 방법을 확인할 수 없습니다. '다운로드' 버튼을 클릭하여 릴리스 페이지에서 직접 다운로드한 후 수동으로 업그레이드하십시오."),
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "트랙패드 속도"),
("Default trackpad speed", "기본 트랙패드 속도"),
("Numeric one-time password", "일회용 비밀번호"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/kz.rs b/src/lang/kz.rs
index e5990c8b4..19d4c0062 100644
--- a/src/lang/kz.rs
+++ b/src/lang/kz.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/lt.rs b/src/lang/lt.rs
index 9a05cd7ab..37adeb2ac 100644
--- a/src/lang/lt.rs
+++ b/src/lang/lt.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/lv.rs b/src/lang/lv.rs
index 60f33bb59..46ae0e397 100644
--- a/src/lang/lv.rs
+++ b/src/lang/lv.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Skārienpaliktņa ātrums"),
("Default trackpad speed", "Noklusējuma skārienpaliktņa ātrums"),
("Numeric one-time password", "Vienreiz lietojama ciparu parole"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/nb.rs b/src/lang/nb.rs
index ceafaddfe..4a646251c 100644
--- a/src/lang/nb.rs
+++ b/src/lang/nb.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/nl.rs b/src/lang/nl.rs
index 02068e6f6..e09f88551 100644
--- a/src/lang/nl.rs
+++ b/src/lang/nl.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Snelheid Trackpad"),
("Default trackpad speed", "Standaardsnelheid Trackpad"),
("Numeric one-time password", "Eenmalig numeriek wachtwoord"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/pl.rs b/src/lang/pl.rs
index 2910fef94..2ea8b4153 100644
--- a/src/lang/pl.rs
+++ b/src/lang/pl.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs
index aab5a2155..8a7923159 100644
--- a/src/lang/pt_PT.rs
+++ b/src/lang/pt_PT.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs
index 1f0da1499..5148c0e46 100644
--- a/src/lang/ptbr.rs
+++ b/src/lang/ptbr.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ro.rs b/src/lang/ro.rs
index 302f45e0f..480b14af8 100644
--- a/src/lang/ro.rs
+++ b/src/lang/ro.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ru.rs b/src/lang/ru.rs
index 42951efec..168ed36ab 100644
--- a/src/lang/ru.rs
+++ b/src/lang/ru.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Скорость трекпада"),
("Default trackpad speed", "Скорость трекпада по умолчанию"),
("Numeric one-time password", "Цифровой одноразовый пароль"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sc.rs b/src/lang/sc.rs
index 74d0b2cd2..3fc686b15 100644
--- a/src/lang/sc.rs
+++ b/src/lang/sc.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sk.rs b/src/lang/sk.rs
index 65f3fe90b..29c92bf5f 100644
--- a/src/lang/sk.rs
+++ b/src/lang/sk.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sl.rs b/src/lang/sl.rs
index ba6b97915..e4ee52623 100755
--- a/src/lang/sl.rs
+++ b/src/lang/sl.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sq.rs b/src/lang/sq.rs
index 4cc47d084..d42be522f 100644
--- a/src/lang/sq.rs
+++ b/src/lang/sq.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sr.rs b/src/lang/sr.rs
index be6e1f18b..374184494 100644
--- a/src/lang/sr.rs
+++ b/src/lang/sr.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sv.rs b/src/lang/sv.rs
index ca8aaf0be..c5a0952da 100644
--- a/src/lang/sv.rs
+++ b/src/lang/sv.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ta.rs b/src/lang/ta.rs
index 681085379..f9ac6a3af 100644
--- a/src/lang/ta.rs
+++ b/src/lang/ta.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/template.rs b/src/lang/template.rs
index f0a030f88..72a2d0e69 100644
--- a/src/lang/template.rs
+++ b/src/lang/template.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/th.rs b/src/lang/th.rs
index 246ea54c7..1b594ec10 100644
--- a/src/lang/th.rs
+++ b/src/lang/th.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/tr.rs b/src/lang/tr.rs
index 7bd025204..05ff74115 100644
--- a/src/lang/tr.rs
+++ b/src/lang/tr.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/tw.rs b/src/lang/tw.rs
index c8bf32c60..eb2c3a715 100644
--- a/src/lang/tw.rs
+++ b/src/lang/tw.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "觸控板速度"),
("Default trackpad speed", "預設觸控板速度"),
("Numeric one-time password", "數字一次性密碼"),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/uk.rs b/src/lang/uk.rs
index cb934e459..6dcc90b7d 100644
--- a/src/lang/uk.rs
+++ b/src/lang/uk.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/vi.rs b/src/lang/vi.rs
index 6f3d1ea9e..09ab7fc17 100644
--- a/src/lang/vi.rs
+++ b/src/lang/vi.rs
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
+ ("Enable IPv6 P2P connection", ""),
+ ("Enable UDP hole punching", ""),
].iter().cloned().collect();
}
diff --git a/src/ui_interface.rs b/src/ui_interface.rs
index b1ce62643..ec90d4912 100644
--- a/src/ui_interface.rs
+++ b/src/ui_interface.rs
@@ -4,7 +4,7 @@ use hbb_common::{
allow_err,
bytes::Bytes,
config::{
- self, keys::*, option2bool, Config, LocalConfig, PeerConfig, CONNECT_TIMEOUT,
+ self, keys::*, Config, LocalConfig, PeerConfig, CONNECT_TIMEOUT,
RENDEZVOUS_PORT,
},
directories_next,
@@ -208,7 +208,7 @@ pub fn use_texture_render() -> bool {
#[inline]
pub fn get_local_option(key: String) -> String {
- LocalConfig::get_option(&key)
+ crate::get_local_option(&key)
}
#[inline]
@@ -1185,7 +1185,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver