A desktop TCP/UDP session lab — multi-tab sessions, ASCII/HEX payloads, structured logs, and per-tab persisted UI state.
简体中文: README.zh.md
Getting Started
·
Report Bug
·
Request Feature
Table of Contents
NetOcto is a desktop TCP/UDP session lab built with Tauri 2, React 19, and TypeScript. It helps you start TCP/UDP server or client sessions, inspect traffic in a structured log, send outbound payloads (including loop send), and manage multiple isolated sessions in parallel tabs.
Networking runs in Rust (Tokio); the UI is a Vite SPA using HeroUI v3 and Tailwind CSS v4.
- Session modes: TCP server, TCP client, UDP server, UDP client (UDP client supports unicast, broadcast, and multicast profiles).
- TCP client link options: Auto-reconnect (interval, max attempts, exponential backoff), application-layer heartbeat with RX idle timeout, optional OS TCP keepalive; link state is observable in the UI and logs (
nc-tcp-link). - Multi-tab workspace: Each tab has its own
session_id, backendNcState, andlocalStoragesettings (netocto.settings.v1.<tabId>); tab list and titles survive restarts. - Payloads: ASCII or HEX send/receive; HEX editor supports
//full-line comments and byte-oriented formatting; optional ASCII escape parsing on send. - Message editor: Multi-line editor, preset messages, loop send, send history, and syntax-style highlighting for comments vs payload.
- Toolbox: Modbus RTU CRC-16 calculator (copy / insert into the active tab editor).
- Events: Logs, client lists, stats, and server state are pushed from Rust via Tauri events (
nc-log,nc-clients,nc-stats,nc-server,nc-tcp-link, …). - i18n: English and Chinese UI in
src/i18n/catalog.ts(browser locale + manual switch in Settings).
| Layer | Role |
|---|---|
src-tauri/ |
Tauri shell; network_cat.rs and tcp_client_link.rs own sockets, session registry, and #[tauri::command] handlers. |
src/ |
React UI: NetOctoApp, NetOctoSession, hexInput.ts, persist.ts, tcpLink.ts, tools under src/tools/. |
src/App.tsx |
Routes main webview vs settings webview by label. |
src/
App.tsx # Root: I18n + main vs settings window
main.tsx
network/
NetOctoApp.tsx # Tab strip, sessions, settings / tools entry
NetOctoSession.tsx # Sidebar, log, message editor, TCP link card
hexInput.ts # HEX normalize, editor format, extract for send
persist.ts # Per-tab settings
tcpLink.ts # TCP reconnect / heartbeat UI helpers
tools/modbus/ # Modbus CRC-16
i18n/ # Locale catalog + React context
SettingsWindowPage.tsx # Standalone settings webview
src-tauri/
src/lib.rs # Registers commands + SessionRegistry
src/network_cat.rs # TCP/UDP implementation + commands
src/tcp_client_link.rs # TCP client reconnect + heartbeat
- Node.js (LTS recommended) and pnpm or npm (Tauri config may use
pnpmforbeforeDevCommand/beforeBuildCommand;npmworks if you adjust scripts). - Rust toolchain (stable) and platform targets for Tauri 2.
- Clone the repo
git clone https://github.com/iotplanet/net-octo.git cd net-octo - Install dependencies
pnpm install # or: npm install - Run the desktop app (Tauri + Vite)
pnpm tauri dev # or: npm run tauri dev - Optional — web-only UI (no native sockets)
pnpm dev # or: npm run dev
- Create or select a session tab, choose TCP Server / TCP Client / UDP Server / UDP Client, set bind or remote host/port, then Start.
- Watch RX traffic in the log panel; tune display options (wrap, hide recv, auto-scroll, export/import JSON logs).
- Compose payloads in the message editor (ASCII or HEX), send once or enable loop send; use presets for quick replay.
- For TCP Client, configure Link · reconnect & heartbeat in the sidebar before starting; status appears in the stats bar and tab title when reconnecting.
- Open Tools (wrench) for Modbus RTU CRC-16 — copy or insert results into the active tab editor.
| Command | Purpose |
|---|---|
nc_start_session |
Start TCP/UDP session for a session_id + webview_label. |
nc_stop_session |
Stop session for a tab. |
nc_stop_server |
Stop server-side listener (if applicable). |
nc_send |
Send payload to selected target(s). |
nc_disconnect |
Disconnect / remove client mapping. |
nc_reset_stats |
Reset TX/RX counters for the session. |
For the classic flat readme, see README.md.
- Multi-tab TCP/UDP sessions with persisted per-tab settings
- TCP client auto-reconnect and application heartbeat
- Modbus RTU CRC-16 toolbox (Phase 1)
- JT/T 808 — terminal positioning & messaging (frame parse, escape, checksum, templates)
- JT/T 1078 — video / channel negotiation as an optional session type or plugin
- Ecosystem glue: JT/T 809, 905, and similar stacks as modular decoders on the existing log/send pipeline
See the open issues for proposed features and known issues.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag enhancement.
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the Mulan Permissive Software License, Version 2 (Mulan PSL v2). See LICENSE for the full text. Official information: MulanPSL2.
iotplanet — github.com/iotplanet/net-octo
Project Link: https://github.com/iotplanet/net-octo