Skip to content

iotplanet/net-octo

Repository files navigation

GitHub Actions Workflow Status GitHub contributors GitHub last commit GitHub License


Logo

NetOcto

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

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.

Features

  • 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, backend NcState, and localStorage settings (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).

Architecture

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.

Repository layout

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

(back to top)

Built With

  • Tauri
  • React
  • Vite
  • Rust
  • TypeScript

(back to top)

Getting Started

Prerequisites

  • Node.js (LTS recommended) and pnpm or npm (Tauri config may use pnpm for beforeDevCommand / beforeBuildCommand; npm works if you adjust scripts).
  • Rust toolchain (stable) and platform targets for Tauri 2.

Installation

  1. Clone the repo
    git clone https://github.com/iotplanet/net-octo.git
    cd net-octo
  2. Install dependencies
    pnpm install
    # or: npm install
  3. Run the desktop app (Tauri + Vite)
    pnpm tauri dev
    # or: npm run tauri dev
  4. Optional — web-only UI (no native sockets)
    pnpm dev
    # or: npm run dev

(back to top)

Usage

  1. Create or select a session tab, choose TCP Server / TCP Client / UDP Server / UDP Client, set bind or remote host/port, then Start.
  2. Watch RX traffic in the log panel; tune display options (wrap, hide recv, auto-scroll, export/import JSON logs).
  3. Compose payloads in the message editor (ASCII or HEX), send once or enable loop send; use presets for quick replay.
  4. For TCP Client, configure Link · reconnect & heartbeat in the sidebar before starting; status appears in the stats bar and tab title when reconnecting.
  5. Open Tools (wrench) for Modbus RTU CRC-16 — copy or insert results into the active tab editor.

Tauri commands (Rust → frontend)

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.

(back to top)

Roadmap

  • 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.

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Top contributors:

contrib.rocks image

License

Distributed under the Mulan Permissive Software License, Version 2 (Mulan PSL v2). See LICENSE for the full text. Official information: MulanPSL2.

(back to top)

Contact

iotplanetgithub.com/iotplanet/net-octo

Project Link: https://github.com/iotplanet/net-octo

(back to top)

Acknowledgments

  • Tauri — desktop shell and IPC
  • HeroUI — React component library
  • Tokio — async networking on the Rust side

(back to top)

About

A desktop TCP/UDP session lab

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors