• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobotWebTools / rclnodejs / 25156467665
85%

Build:
DEFAULT BRANCH: develop
Ran 30 Apr 2026 09:10AM UTC
Jobs 1
Files 55
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Apr 2026 08:52AM UTC coverage: 85.864%. Remained the same
25156467665

push

github

web-flow
Add lightweight WebSocket bridge for browser access to ROS 2 (#1495)

Adds a lightweight WebSocket bridge built into rclnodejs so a plain browser (or any WebSocket-capable client) can talk to ROS 2 with **no JavaScript library** on the client side — built-in `WebSocket` + `JSON` are enough.

## Highlights

- **Resource-style URLs**: `ws://host:port/topic/<name>?type=<pkg>/msg/<Type>` and `ws://host:port/service/<name>?type=<pkg>/srv/<Type>`; the URL *is* the topic/service, the WS frame *is* the ROS message as JSON.
- **Same Node.js process** as your `rclnodejs` app — no extra Python service to deploy or version-match against ROS distros.
- **Lightweight alternative to `rosbridge_suite` + `roslibjs`** for the common pub/sub + service-client cases (full comparison table in `rosocket/README.md`).
- **CLI shipped as a `bin` entry** — `npx rosocket --port 9000 --topic /chatter:std_msgs/msg/String`; supports repeatable `--topic`/`--service` defaults, `--host`, `--node-name`, integer-validated `--port`, and clean SIGINT/SIGTERM shutdown with a hard-exit fallback.
- **Programmatic API**: `const { startRosocket } = require('rclnodejs/rosocket'); await startRosocket({ node, port, topicTypes, serviceTypes, verifyClient })`.
- **Optional pre-declared types** (`topicTypes` / `serviceTypes`) let browsers omit `?type=`; without them the bridge stays generic.
- **Service envelope**: bare `{a,b}` request shape *or* wrapped `{id, request:{...}}` for concurrent in-flight call correlation; responses echo the same shape.
- **64-bit ints**: accepts JSON numbers or BigInt-encoded strings (`"12n"`); responses use the rclnodejs `toJSONSafe` encoding.
- **Error/close conventions**: `{error: "<msg>"}` frames; protocol violations close with `1008`, server errors with `1011`.
- **`verifyClient` hook** wraps `ws`'s native `(info, cb)` callback into the documented `(req: IncomingMessage) => boolean` signature.
- **Tests**: 7 mocha cases covering unknown-path/missing-type rejection,... (continued)

1567 of 1987 branches covered (78.86%)

Branch coverage included in aggregate %.

3183 of 3545 relevant lines covered (89.79%)

449.21 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25156467665.1 30 Apr 2026 09:10AM UTC 55
85.86
GitHub Action Run
Source Files on build 25156467665
  • Tree
  • List 55
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25156467665
  • 3176aca5 on github
  • Prev Build on develop (#24660309015)
  • Next Build on develop (#25214968917)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc