From 6918d35935b48b03ab24f11dfda48b6379807cbf Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 3 Sep 2026 20:14:42 +0800 Subject: [PATCH 1/3] proto: PortForwardChannel family for a multiplexed port-forward tunnel Adds PortForward.multiplex, Features.port_forward_mux and the open/opened/data/close/window_update channel frames, union tag 33. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab --- protos/message.proto | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/protos/message.proto b/protos/message.proto index 8b21368..4d3b9fd 100644 --- a/protos/message.proto +++ b/protos/message.proto @@ -55,6 +55,7 @@ message DisplayInfo { message PortForward { string host = 1; int32 port = 2; + bool multiplex = 3; } message FileTransfer { @@ -104,6 +105,7 @@ message ChatMessage { string text = 1; } message Features { bool privacy_mode = 1; bool terminal = 2; + bool port_forward_mux = 3; } message CodecAbility { @@ -949,6 +951,46 @@ message TerminalResponse { } } +message PortForwardOpen { + int32 channel_id = 1; + string host = 2; + int32 port = 3; + uint32 window = 4; +} + +message PortForwardOpened { + int32 channel_id = 1; + bool success = 2; + string message = 3; + uint32 window = 4; +} + +message PortForwardData { + int32 channel_id = 1; + bytes data = 2; +} + +message PortForwardClose { + int32 channel_id = 1; +} + +message PortForwardWindowUpdate { + int32 channel_id = 1; + uint32 add = 2; +} + +// One symmetric message for both directions. `open` only travels controller -> controlled, +// `opened` only controlled -> controller; a frame in the wrong direction is ignored. +message PortForwardChannel { + oneof union { + PortForwardOpen open = 1; + PortForwardOpened opened = 2; + PortForwardData data = 3; + PortForwardClose close = 4; + PortForwardWindowUpdate window_update = 5; + } +} + message Message { oneof union { SignedId signed_id = 3; @@ -981,5 +1023,6 @@ message Message { ScreenshotResponse screenshot_response= 30; TerminalAction terminal_action = 31; TerminalResponse terminal_response = 32; + PortForwardChannel port_forward_channel = 33; } } From 1e617ddf4d7e13ee1d24a339154020b1ccf9a940 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 4 Sep 2026 01:25:08 +0800 Subject: [PATCH 2/3] config: enable-port-forward-mux local setting Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab --- src/config.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.rs b/src/config.rs index e968ec4..ac7ab49 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2995,6 +2995,7 @@ pub mod keys { // Connection punch-through options pub const OPTION_ENABLE_UDP_PUNCH: &str = "enable-udp-punch"; pub const OPTION_ENABLE_IPV6_PUNCH: &str = "enable-ipv6-punch"; + pub const OPTION_ENABLE_PORT_FORWARD_MUX: &str = "enable-port-forward-mux"; pub const OPTION_HIDE_USERNAME_ON_CARD: &str = "hide-username-on-card"; pub const OPTION_HIDE_HELP_CARDS: &str = "hide-help-cards"; pub const OPTION_DEFAULT_CONNECT_PASSWORD: &str = "default-connect-password"; @@ -3126,6 +3127,7 @@ pub mod keys { OPTION_VIDEO_SAVE_DIRECTORY, OPTION_ENABLE_UDP_PUNCH, OPTION_ENABLE_IPV6_PUNCH, + OPTION_ENABLE_PORT_FORWARD_MUX, OPTION_TOUCH_MODE, OPTION_SHOW_VIRTUAL_MOUSE, OPTION_SHOW_VIRTUAL_JOYSTICK, From 60c7fd80ea23cd64b363a25cb3cef0bddee95c5b Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Fri, 4 Sep 2026 15:37:18 +0800 Subject: [PATCH 3/3] Update comment for connection punch-through options Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index ac7ab49..0e5f184 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2992,7 +2992,7 @@ pub mod keys { pub const OPTION_ALLOW_COMMAND_LINE_SETTINGS_WHEN_SETTINGS_DISABLED: &str = "allow-command-line-settings-when-settings-disabled"; - // Connection punch-through options + // Connection punch-through / port-forward options pub const OPTION_ENABLE_UDP_PUNCH: &str = "enable-udp-punch"; pub const OPTION_ENABLE_IPV6_PUNCH: &str = "enable-ipv6-punch"; pub const OPTION_ENABLE_PORT_FORWARD_MUX: &str = "enable-port-forward-mux";