RCWeb API

TargetR RCWeb hosts browser apps over HTTP and HTTPS and relays JavaScript commands between connected browsers over WebSockets. This API documentation covers the Java server.

Server overview

Communication model

Browsers join a room using a room code and a client ID. Apps in the same room can send commands to selected clients or app names, allowing different pages, such as a phone controller and a shared display, to work together. The server routes commands; the receiving browser executes the JavaScript.

App logic and application state normally live in the browsers. The server retains room membership, connections, queued commands, caches and pending operations in memory. Commands can update a page without reloading it, but sending a command does not confirm its receipt or execution.

Server architecture

  • net.targetr.rc: Application startup and routing, with subpackages for rooms, browser connections, file transfers, MCP tools and monitoring.
  • net.targetr.wtm3: Web Traffic Manager 3, the transport layer providing HTTP handling on virtual threads, TLS and ACME certificates, WebSockets, resource caching and outbound HTTP proxies.
  • net.targetr.tncaptcha: Experimental animated CAPTCHA image generation; it does not manage challenge sessions or verify answers.

Start with Main for server initialization and RootResponder for HTTP routing. Room management and browser connections implement command delivery. The MCP endpoint lists connected clients in a supplied room and executes JavaScript in a selected browser with a correlated reply.

Requirements

The project targets Java 21 and builds with Maven. Direct runtime dependencies are CommonMark for rendering Markdown and acme4j for certificate acquisition. Transitive dependencies include Bouncy Castle for certificate generation and jose4j for JSON support. Tests use JUnit Jupiter.

Package
Description
Remote Control Web application startup and HTTP request routing.
Browser connections, JavaScript command delivery and browser-hosted file transfers.
Model Context Protocol (MCP) access to connected RCWeb browsers.
Operational monitoring of the RCWeb server and its communications.
Server health sampling, recent history and JSON monitoring responses.
Integration between transport interception and RCWeb communication monitors.
HTTP request log entries, live monitoring and daily log-file output.
Live monitoring of incoming and outgoing WebSocket frame metadata.
Room membership, command routing and room lifecycle management.
RCWeb identifier generation, HTTP response helpers and external API routing.
Experimental temporal-noise CAPTCHA image generation.
Shared configuration and statistics for Web Traffic Manager 3 (WTM3).
In-memory resource caching and static HTTP response generation.
Stream framing, reusable byte buffers and serialization helpers for WTM3.
Common socket abstraction for plain and TLS server connections.
HTTP server connections, message models and application response dispatch.
HTTP request forwarding and streamed responses from upstream servers.
Basic in-memory caching of responses from upstream HTTP targets.
Concrete HTTP responses and response-related error handling.
WebSocket upgrades, frame transport and connection lifecycle handling.
TLS detection, domain certificate selection and secure socket setup.
ACME certificate acquisition and renewal for server domains.
General timing, formatting and request-rate helpers for the server.