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

node-opcua / node-opcua / 25845700254 / 1
92%
master: 92%

Build:
DEFAULT BRANCH: master
Ran 14 May 2026 07:18AM UTC
Files 1223
Run time 35s
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

14 May 2026 06:32AM UTC coverage: 92.174% (-0.02%) from 92.189%
25845700254.1

push

github

erossignon
feat(client-browser): WebSocket transport + unit tests

Second slice of the browser-client split. Adds the
`node-opcua-client-browser` WebSocket transport implementation that
satisfies `IClientTransport` from `node-opcua-transport`, so the upstream
`ClientSecureChannelLayer.transportFactory` option (merged as #1503) can
route client traffic over `opc.ws://` / `opc.wss://` in addition to
`opc.tcp://`.

Purely additive: no existing source file is modified; the package's
public surface grows from `{ VERSION }` to `{ VERSION, ClientWS_transport,
browserWsTransportFactory, parseWsEndpointUrl, OPCUA_UACP_SUBPROTOCOL,
WsSocketAdapter, uacp }`. Follow-up PRs add `createBrowserClient()`, the
standalone browser bundle (esbuild + shims), and the full OPC UA E2E
specs that replace the current smoke test.

Thin re-exports of the byte-level UACP encoders/decoders from
`node-opcua-transport` (`AcknowledgeMessage`, `HelloMessage`,
`TCPErrorMessage`, `packTcpMessage`, `readRawMessageHeader`). Single
point of audit if a future release introduces a Node-only import there.

`WsSocketAdapter` wraps a browser/`ws`-package WebSocket into an
`ISocketLike` that `TCP_transport` from `node-opcua-transport` can
consume unchanged. Handles:

- event translation: `open` → `connect`, binary `message` → `data`,
  `close` → `end` + `close(hadError)`, `error` → `error`.
- outgoing writes: ArrayBuffer/Buffer/Uint8Array normalized to a
  binary WebSocket frame (one UACP chunk per frame, per Part 6 §7.5).
- lifecycle: `end()` closes with code 1000, `destroy()` with 1001.
- stubs for `setKeepAlive`, `setNoDelay`, `setTimeout` so the
  TCP_transport setup sequence runs without changes.

Text frames are ignored with a `console.warn`, per spec.

`ClientWS_transport extends ClientTCP_transport`. Overrides `connect()`
to construct a `WebSocket`, wrap it in `WsSocketAdapter`, and hand it
to the parent's `_install_socket` + `_perform_HEL_ACK_transaction`.
HEL/ACK + chunk-reassembly machinery is i... (continued)

18650 of 22175 branches covered (84.1%)

163437 of 177314 relevant lines covered (92.17%)

469087.59 hits per line

Source Files on job 25845700254.1
  • Tree
  • List 1223
  • Changed 5
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25845700254
  • 51d30872 on github
  • Prev Job for on master (#25809750526.1)
  • Next Job for on master (#25848855345.1)
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