Commit 5b6e5e7
authored
HTTP transport for call/publish (#1512)
- New `HttpTransport` (lib/runtime/transports/http.js): POST /{basePath}/capability/{call|publish}/{name}, dispatcher-code → HTTP-status mapping, 1 MiB body cap, optional verifyRequest hook. Re-exported from lib/runtime/index.{js,d.ts}.
- Browser SDK (web/client.js, web/index.d.ts) now multi-transport: connect() / RosClient accept `string | { http, ws }` and pick the transport from the URL scheme. http:// derives a sibling ws:// URL and opens it lazily on first subscribe(). New _HttpLink uses fetch() and surfaces structured errors (network_error, invalid_response, http_<status>).
- Tests: test/test-web-http.js (+423, 23 cases covering wire format, SDK, and defensive paths). test-web.js → test-web-ws.js.
- CI: suppress two Node-internal LSan reports (ContextifyContext, ContextifyScript) triggered once we load web/client.js as ESM and call fetch() — singletons retained for process lifetime.
- Drop unused WebSocketConnection export from transports/ws.js.
Fix: #15101 parent 134e06b commit 5b6e5e7
9 files changed
Lines changed: 1200 additions & 55 deletions
File tree
- lib/runtime
- transports
- test
- web
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
107 | 121 | | |
108 | 122 | | |
109 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
137 | 139 | | |
0 commit comments