🔄 A modern, native macOS port forwarding tool with glass-effect UI. Drop-in replacement for
socaton macOS.
| Feature | Description |
|---|---|
| 🖥️ Native macOS App | Built with SwiftUI, optimized for macOS 14+ with glass-effect design |
| 📡 TCP & UDP | Forward both TCP and UDP traffic simultaneously or independently |
| 🧩 Multi-Rule | Manage multiple port forwarding rules with persistent storage |
| 📊 Real-time Stats | Live connection count, data transfer monitoring |
| 📝 Log Viewer | Built-in log filtering by severity (Info, Success, Warning, Error) |
| 🔔 Menu Bar | System status bar integration for quick access |
| ⚡ Auto-start | Rules can auto-start when the app launches |
| 💾 Persistent | All rules saved automatically via UserDefaults |
- Download
PortForwarder.dmgfrom the Releases page - Open the DMG and drag
PortForwarder.appto your Applications folder - Launch from Launchpad or Spotlight
Equivalent to the socat command:
socat TCP4-LISTEN:2283,fork TCP4:192.168.97.5:2283In Port Forwarder:
- Click + to add a new rule
- Fill in:
- Local IP:
0.0.0.0(or127.0.0.1) - Local Port:
2283 - Target IP:
192.168.97.5 - Target Port:
2283 - Protocol: ✅ TCP
- Local IP:
- Click 创建规则 (Create Rule)
- Click 启动 (Start)
Done! The port is now being forwarded.
The app features a modern macOS glass-effect UI with translucent backgrounds, native sidebar navigation, and clean card-based layouts.
(Screenshots coming in v1.0.1)
- macOS 14+ (Sonoma or newer)
- Xcode 15+ / Swift 6.3+
git clone https://github.com/YOUR_USERNAME/PortForwarder.git
cd PortForwarder
swift build -c release# Build the app bundle
mkdir -p build/PortForwarder.app/Contents/MacOS
mkdir -p build/PortForwarder.app/Contents/Resources
cp .build/release/PortForwarder build/PortForwarder.app/Contents/MacOS/
cp Resources/Info.plist build/PortForwarder.app/Contents/
# Create DMG
hdiutil create -volname "Port Forwarder" \
-srcfolder build/PortForwarder.app \
-ov -format UDBZ \
PortForwarder.dmgPortForwarder/
├── Package.swift # Swift Package Manager manifest
├── Sources/
│ ├── PortForwarderApp.swift # App entry point
│ ├── AppDelegate.swift # NSApplicationDelegate & status bar
│ ├── PortForwarderEngine.swift # TCP/UDP forwarding engine (BSD sockets)
│ ├── ForwardRule.swift # Data model & persistent storage
│ ├── LogManager.swift # Log entry management
│ ├── ContentView.swift # Main window (NavigationSplitView)
│ ├── RuleDetailView.swift # Rule detail & stats panel
│ ├── RuleEditorSheet.swift # New rule modal sheet
│ ├── LogView.swift # Filtered log viewer
│ └── VisualEffectView.swift # macOS glass effect helpers
├── Resources/
│ └── Info.plist # App bundle metadata
└── README.md
| Capability | socat |
Port Forwarder |
|---|---|---|
| TCP forwarding | ✅ | ✅ |
| UDP forwarding | ✅ | ✅ |
| Multiple rules | Manual scripts | ✅ GUI managed |
| Persistent config | None | ✅ Auto-save |
| Visual monitoring | None | ✅ Real-time stats |
| macOS native | CLI only | ✅ Native app |
| Menu bar access | None | ✅ Status bar icon |
MIT License — see LICENSE for details.
Inspired by the original Port-Forwarder project by Lance-He, reimagined as a modern native macOS application.