Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ mosquitto/log/
__pycache__/
*.pyc
*.pyo

*.tar.gz
*.local
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

## ✨ 核心特性

- 🚀 **RaaS 架构** - 将远端 TCP 服务(gRPC/REST)代理到本地,公网访问与局域网完全一致
- ⚡ **高性能** - Rust + Tokio 异步运行时,协程并发,极低转发开销
- 🛡️ **内存安全** - Rust 所有权系统,编译期保证并发安全
- 📡 **极简部署** - MQTT 信令通道,无需 WebSocket 服务器,结合 EMQX 可快速实现统一鉴权
- 🖥️ **跨平台** - Linux (x86_64/aarch64) 和 Windows
- 🔌 **协议无关** - 支持所有基于 TCP 的应用层协议
- 🚀 **远程直连** - 将远端内网 TCP 服务代理至本地,使公网访问体验与局域网完全一致。两端仅需运行轻量可执行文件即可实现跨网段服务直连。
- 📡 **极简部署** - 仅需公网部署 MQTT 用于信令交换与 TURN 用于中继,无需开发维护有状态的 WS 信令服务或配置复杂的代理规则与访问控制列表。
- 🛡️ **高效安全** - 充分利用 Rust 现代异步生态,采用基于 MPSC 的事件驱动模型替代传统回调,规避回调地狱的同时降低系统耦合度,架构比 C++ 更稳定易迭代。
- 🔐 **安全管控** - 将复杂的权限管理转化为对 MQTT 话题的读写权限管理,基于 EMQX 与 Authing 可快速实现生产级的访问控制。
- 💻 **跨端通用** - 支持 Linux (x86/ARM) 与 Windows 平台和所有基于 TCP 的服务(gRPC/REST),现有的 C/S 端应用仅需修改一行连接地址即可快速接入。

## 🚀 快速开始

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ services:
# Release 版本编译(优化后,体积更小)
build-release-x86_64:
<<: *rust-settings
command: cargo build --target x86_64-unknown-linux-gnu --release
command: cargo build --target x86_64-unknown-linux-gnu --release --all-features

build-release-aarch64:
<<: *rust-settings
command: cargo build --target aarch64-unknown-linux-gnu --release
command: cargo build --target aarch64-unknown-linux-gnu --release --all-features

build-release-win64:
<<: *rust-settings
command: cargo build --target x86_64-pc-windows-gnu --release
command: cargo build --target x86_64-pc-windows-gnu --release --all-features

# ============ 测试服务 ============
# 测试环境:MQTT Broker + TCP Echo Server + Proxy + Portal + Test Client
Expand Down
56 changes: 56 additions & 0 deletions scripts/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -e

# =========================
# 多 target 配置
# =========================

TARGETS=(
x86_64-unknown-linux-gnu
aarch64-unknown-linux-gnu
)

ARCHIVE_EXT="tar.gz"

BINS=(
"proxyd"
"portald"
"portal_hub_grpc"
"portal_hub_rest"
)

# =========================
# 主循环
# =========================

for TARGET in "${TARGETS[@]}"; do
echo "=============================="
echo "Packaging target: $TARGET"
echo "=============================="

STAGING="remote_rpc_rs-${TARGET}"
RELEASE_DIR="target/${TARGET}/release"

rm -rf "$STAGING"
mkdir -p "$STAGING"

for bin in "${BINS[@]}"; do
if [ -f "$RELEASE_DIR/$bin.exe" ]; then
cp "$RELEASE_DIR/$bin.exe" "$STAGING/"
elif [ -f "$RELEASE_DIR/$bin" ]; then
cp "$RELEASE_DIR/$bin" "$STAGING/"
else
echo "⚠️ Skip $bin (not found for $TARGET)"
fi
done

if [ "$ARCHIVE_EXT" = "zip" ]; then
7z a "${STAGING}.zip" "$STAGING"
echo "Output: ${STAGING}.zip"
else
tar -czvf "${STAGING}.tar.gz" "$STAGING"
echo "Output: ${STAGING}.tar.gz"
fi

echo
done