Created attachment 264243 [details] patch rdp2tcp is a tunneling tool on top of remote desktop protocol (RDP). It uses RDP virtual channel capabilities to multiplex several ports forwarding over an already established rdesktop or FreeRDP session. Available features: - tcp port forwarding - reverse tcp port forwarding - process stdin/out forwarding - SOCKS5 minimal support The code is splitted into 2 parts: - the client running on the rdesktop or FreeRDP client side - the server running on the Terminal Server side This port only contains client and tools.
Have you tested it? Does it work? It doesn't even run with FreeRDP3. It does run with FreeRDP2, but I couldn't get port forwarding working.
(In reply to Vladimir Druzenko from comment #1) Not yet. I plan to do it in next few days.
At least current freerdp run it: 97621 - S 9:18.05 |-- /usr/local/bin/Thunar --gapplication-service (thunar) 83900 - I 0:01.13 | `-- xfreerdp /bpp:24 -wallpaper +decorations +window-drag +aero +clipboard +aero +async-input +async-update /rdp2tcp:/usr/local/bin/rdp2tcp 84034 - I 0:00.01 | `-- /usr/local/bin/rdp2tcp
(In reply to Vladimir Druzenko from comment #1) You was right, FreeRDP3 at FBSD is build without rdp2tcp support: [00:44:56:783] [58860:000bce96] [ERROR][com.winpr.library] - [LoadLibraryA]: failed with Cannot open "/usr/local/lib/freerdp3/librdp2tcp-client.so" [00:44:56:783] [58860:000bce96] [WARN][com.freerdp.addin] - [freerdp_load_channel_addin_entry]: Failed to load channel rdp2tcp [(null)] [00:44:56:783] [58860:000bce96] [ERROR][com.winpr.library] - [LoadLibraryA]: failed with Cannot open "/usr/local/lib/freerdp3/librdp2tcp-client.so" [00:44:56:783] [58860:000bce96] [WARN][com.freerdp.addin] - [freerdp_load_channel_addin_entry]: Failed to load channel rdp2tcp [(null)] [00:44:56:783] [58860:000bce96] [ERROR][com.freerdp.client.common] - [freerdp_client_load_channels]: Failed to load addins [00000000] To fix it: CMAKE_ON+= CHANNEL_RDP2TCP and rebuild + reinstall freerdp3. 9411 40 Is 0:00.43 | | |-- csh 84354 40 I+ 0:00.15 | | | `-- xfreerdp3 /bpp:24 +window-drag +clipboard /size:1280x960 /sec:rdp /cert-ignore /rdp2tcp:/usr/local/bin/rdp2tcp 84489 40 S+ 0:00.02 | | | `-- /usr/local/bin/rdp2tcp Probably some other channels also disabled by default in FreeRDP CMake files. Console on win server and on FBSD shows that both sides connected via RDP channel.
Created attachment 264277 [details] patch Add shebang fixes.
(In reply to Vladimir Druzenko from comment #1) Just finish tests: it work with freerdp3 after change that was in prev messages. Looks like with freerdp 2 also work. For tests I do compile windows server rdp2tcp part from same sources. Also I do patch FreeRDP3 to allow to set custom channel name. https://github.com/FreeRDP/FreeRDP/pull/11916
Suggested Makefile (tabs are broken due to copy&paste from console): PORTNAME= rdp2tcp DISTVERSION= 0.1.0.20250804 CATEGORIES= net comms PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ PATCHFILES+= 1e45654b6e23633a9c648d6b0c8bc5b133a0504b.patch:-p1 # https://github.com/V-E-O/rdp2tcp/pull/14 MAINTAINER= rozhuk.im@gmail.com COMMENT= Open tcp tunnel through remote desktop connection (client) WWW= https://github.com/V-E-O/rdp2tcp/ LICENSE= GPLv3 USES= shebangfix USE_GITHUB= yes GH_ACCOUNT= V-E-O GH_TAGNAME= 0a54991e669e8636b129a60e9ff5baa2fc91d1af SHEBANG_FILES= ${TOOLS_PLIST_FILES:S|bin|tools|} CFLAGS+= -I${WRKSRC}/common PLIST_FILES= bin/rdp2tcp OPTIONS_DEFINE= TOOLS OPTIONS_DEFAULT= TOOLS OPTIONS_SUB= yes TOOLS_DESC= Install rdp2tcp.py and rdpupload TOOLS_USES= python:run TOOLS_PLIST_FILES= bin/rdp2tcp.py \ bin/rdpupload post-patch: @${REINPLACE_CMD} \ -e 's|CC=.*||g' \ -e 's|CFLAGS=.*||g' \ -e 's|LDFLAGS=.*||g' \ ${WRKSRC}/client/Makefile \ ${WRKSRC}/common/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/client/rdp2tcp ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${WRKSRC}/tools/rdp2tcp.py \ ${WRKSRC}/tools/rdpupload ${STAGEDIR}${PREFIX}/bin .include <bsd.port.mk>
(In reply to Ivan Rozhuk from comment #6) I can add this patch to net/freerdp3 (I'm the maintainer). Ok?
Thanks, but why 0.1.0? Feel free to do what you want, since this is opensource :)
(In reply to Ivan Rozhuk from comment #9) It's version 0.1: https://github.com/V-E-O/rdp2tcp/blob/master/ChangeLog
Created attachment 264278 [details] patch FreeRDP: https://github.com/rozhuk-im/freebsd-ports/commit/7f7f913206e428c68331e446c7b5e5e4c97ca423
Created attachment 264279 [details] patch fix double uses=shebang
I read this issue: https://github.com/V-E-O/rdp2tcp/issues/15 Is this software broken?
(In reply to Vladimir Druzenko from comment #13) It s not totally broken, on active download it may got out of internal sync and disconnect channel. Probably for upload or small amount of data it works ok. I use it to proxy https and git. git pull with small change pack - is ok. https site - ok for some time. On error - rdp reconnect required to continue use tunnels. IMHO it was PoC, and it requires more time make it more stable. Good thing here is that FreeRDP have no implementation specific code for rdp2tcp app, I mean it use stdin+stdout and any app can be used on client side. Server side uses MS API - every one can write it own client and server part and use FreeRDP without modification.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8c88dbcfe5236b0c43c25b860347084cd7af2994 commit 8c88dbcfe5236b0c43c25b860347084cd7af2994 Author: Ivan Rozhuk <rozhuk.im@gmail.com> AuthorDate: 2025-11-03 02:42:56 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2025-11-03 02:42:56 +0000 net/rdp2tcp: New port: Tunneling tool on top of RDP It uses RDP virtual channel capabilities to multiplex several ports forwarding over an already established rdesktop or FreeRDP session. Available features: - tcp port forwarding - reverse tcp port forwarding - process stdin/out forwarding - SOCKS5 minimal support The code is splitted into 2 parts: - the client running on the rdesktop or FreeRDP client side - the server running on the Terminal Server side This port only contains client and tools. https://github.com/V-E-O/rdp2tcp PR: 289964 net/Makefile | 1 + net/rdp2tcp/Makefile (new) | 47 +++++++++++++++++++++++++++++++++++++++++++++ net/rdp2tcp/distinfo (new) | 5 +++++ net/rdp2tcp/pkg-descr (new) | 15 +++++++++++++++ 4 files changed, 68 insertions(+)
(In reply to Ivan Rozhuk from comment #6) Check please your pull request to FreeRDP.
Friendly ping.