@freerdp-bridge/http 0.0.0-stage → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FreeRDP Browser Bridge contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,82 @@
1
- # Temporary Holding Version
1
+ # @freerdp-bridge/http
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ## Purpose
4
+
5
+ Mount FreeRDP Browser Bridge in a Node.js 24 `node:http` or `node:https`
6
+ application on its existing port. One native C++ worker runs outside Node per
7
+ session. The bounded session/media engine uses an internal Fastify router;
8
+ your application does not need to use Fastify as its server framework.
9
+
10
+ HTTP/HTTPS integration introduced in **0.2.3**. All bridge packages and the
11
+ native runtime use one product version.
12
+
13
+ ## Installation
14
+
15
+ Install the published release with the matching native runtime:
16
+
17
+ ```sh
18
+ npm install @freerdp-bridge/http@0.2.4 @freerdp-bridge/runtime-linux-x64-gnu@0.2.4
19
+ ```
20
+
21
+ Windows x64 uses `runtime-win32-x64` instead. All bridge versions must match.
22
+ For an unpublished development snapshot use a complete local tarball graph.
23
+
24
+ ## Requirements
25
+
26
+ Node.js 24 and a browser are prerequisites. Native packages contain compiled worker/private libraries;
27
+ consumers need no compiler, CMake or system FreeRDP. macOS/ARM/musl packages
28
+ are not supplied. Only HTTP/1.1 is in the intended initial profile.
29
+
30
+ ## Usage
31
+
32
+ ```ts
33
+ import { createServer } from 'node:http';
34
+ import { createRdpBridgeHttp, resolveNativeRuntime } from '@freerdp-bridge/http';
35
+
36
+ const server = createServer((request, response) => {
37
+ if (bridge.handleRequest(request, response)) return;
38
+ response.writeHead(200, { 'content-type': 'application/json' });
39
+ response.end('{"host":true}');
40
+ });
41
+ const bridge = await createRdpBridgeHttp(server, {
42
+ prefix: '/rdp',
43
+ worker: await resolveNativeRuntime({ runtimeRoot: '/private/run/rdp-bridge' }),
44
+ allowedOrigins: ['https://app.example'],
45
+ authenticate: request => verifyApplicationIdentity(request),
46
+ });
47
+ server.listen(8080, '127.0.0.1');
48
+ ```
49
+
50
+ `verifyApplicationIdentity` belongs to the host and returns `{ id: verifiedId }`
51
+ or undefined after actual bearer/mTLS verification. Cookies are refused. Use an
52
+ absolute Windows runtimeRoot on Windows. The host must delegate owned requests
53
+ before body parsing and must not send a second response after a true return.
54
+ Foreign requests/sockets are untouched. There is no extra HTTP listener.
55
+
56
+ Automatic upgrades are prefix-selective. With a catch-all host WS dispatcher,
57
+ set `upgradeMode: 'manual'`, then first call
58
+ `bridge.handleUpgrade(request, socket, head)` and return if true. Delegate a
59
+ false result to the application's own WS router. Do not register competing
60
+ catch-all request or upgrade listeners.
61
+
62
+ Await `bridge.close()` to join its workers/WS without closing the host server.
63
+ Close the bridge before awaiting the host listener's close callback; upgraded
64
+ WS can keep that callback pending. The host closes foreign WS separately. The host-close
65
+ observer is a cleanup fallback; awaiting close is still required for joined
66
+ shutdown and cleanup errors. `diagnostics()` is bounded local telemetry.
67
+ `./browser` exports `referenceBrowserDirectory`; serve only those assets and
68
+ configure the browser client with the same `basePath: '/rdp'` for attach/reattach.
69
+
70
+ ## Limitations
71
+
72
+ The host owns TLS, identity, destination policy, safe access logging and its
73
+ request/WS dispatcher. RDP certificates remain strict by default. Bridge JSON
74
+ is limited to 64 KiB, including chunked requests. Already consumed/preparsed
75
+ bodies are refused. Device/audio capabilities and actual platform acceptance
76
+ remain separate from HTTP adapter tests. No profile/credential persistence or
77
+ arbitrary FreeRDP argv is added.
78
+
79
+ ## License
80
+
81
+ Project-owned code is MIT (LICENSE). Native dependencies retain their own terms
82
+ in the runtime's notices, licenses and corresponding-source directory.
@@ -0,0 +1 @@
1
+ export { referenceBrowserDirectory } from '@freerdp-bridge/api/browser';
@@ -0,0 +1,2 @@
1
+ export { referenceBrowserDirectory } from '@freerdp-bridge/api/browser';
2
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createRdpBridgeHttp, type RdpBridgeHttpOptions, type RdpBridgeHttpHandle, type BridgeHttpServer, } from './server.js';
2
+ export { resolveNativeRuntime, NativeRuntimeError, NativeSessionWorker, WorkerProcess, SessionManager, SessionError, createSecureLogger, } from '@freerdp-bridge/api/fastify';
3
+ export type { WorkerOptions, Principal, SessionCreate, NativeRuntimeOptions, BridgeHandle, } from '@freerdp-bridge/api/fastify';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { createRdpBridgeHttp, } from './server.js';
2
+ export { resolveNativeRuntime, NativeRuntimeError, NativeSessionWorker, WorkerProcess, SessionManager, SessionError, createSecureLogger, } from '@freerdp-bridge/api/fastify';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAIpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,kBAAkB,GACnB,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Server as HttpServer, type IncomingMessage, type ServerResponse } from 'node:http';
2
+ import { Server as HttpsServer } from 'node:https';
3
+ import type { Duplex } from 'node:stream';
4
+ import { type RdpBridgePluginOptions, type BridgeHandle } from '@freerdp-bridge/api/fastify';
5
+ export type BridgeHttpServer = HttpServer | HttpsServer;
6
+ export interface RdpBridgeHttpOptions extends Omit<RdpBridgePluginOptions, 'onReady'> {
7
+ prefix: string;
8
+ authenticate: NonNullable<RdpBridgePluginOptions['authenticate']>;
9
+ }
10
+ export interface RdpBridgeHttpHandle {
11
+ /** True transfers this request/response exclusively to the bridge. */
12
+ handleRequest(request: IncomingMessage, response: ServerResponse): boolean;
13
+ /** False leaves foreign socket/head and credentials untouched. */
14
+ handleUpgrade(request: IncomingMessage, socket: Duplex, head: Buffer): boolean;
15
+ diagnostics(): ReturnType<BridgeHandle['diagnostics']>;
16
+ /** Joins bridge resources without closing the host listener. */
17
+ close(): Promise<void>;
18
+ }
19
+ /** Prepare routing before listen; the host's one request dispatcher calls handleRequest. */
20
+ export declare function createRdpBridgeHttp(host: BridgeHttpServer, options: RdpBridgeHttpOptions): Promise<RdpBridgeHttpHandle>;
package/dist/server.js ADDED
@@ -0,0 +1,217 @@
1
+ import Fastify from 'fastify';
2
+ import { Server as HttpServer, } from 'node:http';
3
+ import { Server as HttpsServer } from 'node:https';
4
+ import { rdpBridgePlugin, } from '@freerdp-bridge/api/fastify';
5
+ const mounts = new WeakMap();
6
+ const fail = (code) => Object.assign(new Error(code), { code });
7
+ class HttpBridge {
8
+ options;
9
+ bridge;
10
+ router;
11
+ initialization;
12
+ retirement;
13
+ closing;
14
+ removeAutomatic = () => undefined;
15
+ removeHostObserver = () => undefined;
16
+ addAutomatic = () => {
17
+ throw fail('HTTP_BRIDGE_NOT_READY');
18
+ };
19
+ observedClosed = false;
20
+ release = () => undefined;
21
+ onHostClose = () => {
22
+ this.observedClosed = true;
23
+ // EventEmitter cannot await a listener. The host must also await close();
24
+ // it receives this same promise, including a sanitized cleanup failure.
25
+ void this.close().catch(() => undefined);
26
+ };
27
+ constructor(options) {
28
+ this.options = options;
29
+ this.router = Fastify({ logger: false, bodyLimit: 65536 });
30
+ }
31
+ static async create(host, options) {
32
+ if (process.versions.node.split('.')[0] !== '24')
33
+ throw fail('HTTP_BRIDGE_NODE_VERSION');
34
+ const candidate = host;
35
+ if (!(candidate instanceof HttpServer) &&
36
+ !(candidate instanceof HttpsServer))
37
+ throw fail('HTTP_BRIDGE_HTTP1_REQUIRED');
38
+ if (!options || typeof options.authenticate !== 'function')
39
+ throw fail('HTTP_BRIDGE_IDENTITY_REQUIRED');
40
+ if (typeof options.prefix !== 'string' ||
41
+ options.prefix.length > 128 ||
42
+ !/^(?:\/[A-Za-z0-9_-]+){1,16}$/.test(options.prefix))
43
+ throw fail('BRIDGE_PREFIX_INVALID');
44
+ if (options.upgradeMode !== undefined &&
45
+ !['automatic', 'manual'].includes(options.upgradeMode))
46
+ throw fail('BRIDGE_UPGRADE_MODE_INVALID');
47
+ const existing = mounts.get(host);
48
+ const prefixes = existing?.prefixes ?? new Set();
49
+ if (prefixes.size >= 16 ||
50
+ [...prefixes].some((prefix) => prefix === options.prefix ||
51
+ prefix.startsWith(options.prefix + '/') ||
52
+ options.prefix.startsWith(prefix + '/')))
53
+ throw fail('BRIDGE_PREFIX_CONFLICT');
54
+ const value = new HttpBridge({ ...options });
55
+ const closers = existing?.closers ?? new Set();
56
+ const upgrades = existing?.upgrades ?? new Set();
57
+ const state = existing ?? {
58
+ prefixes,
59
+ closers,
60
+ upgrades,
61
+ onClose: () => {
62
+ for (const close of [...closers])
63
+ close();
64
+ },
65
+ onUpgrade: (request, socket, head) => {
66
+ for (const upgrade of upgrades)
67
+ if (upgrade(request, socket, head))
68
+ return;
69
+ },
70
+ };
71
+ if (!existing) {
72
+ mounts.set(host, state);
73
+ host.once('close', state.onClose);
74
+ }
75
+ prefixes.add(options.prefix);
76
+ closers.add(value.onHostClose);
77
+ value.removeHostObserver = () => {
78
+ closers.delete(value.onHostClose);
79
+ };
80
+ value.addAutomatic = (handler) => {
81
+ upgrades.add(handler);
82
+ if (upgrades.size === 1)
83
+ host.on('upgrade', state.onUpgrade);
84
+ return () => {
85
+ upgrades.delete(handler);
86
+ if (!upgrades.size)
87
+ host.off('upgrade', state.onUpgrade);
88
+ };
89
+ };
90
+ let released = false;
91
+ value.release = () => {
92
+ if (released)
93
+ return;
94
+ released = true;
95
+ value.removeHostObserver();
96
+ prefixes.delete(options.prefix);
97
+ if (!prefixes.size && mounts.get(host) === state) {
98
+ host.off('close', state.onClose);
99
+ host.off('upgrade', state.onUpgrade);
100
+ mounts.delete(host);
101
+ }
102
+ };
103
+ value.initialization = value.install();
104
+ try {
105
+ await value.initialization;
106
+ if (value.observedClosed) {
107
+ await value.close();
108
+ throw fail('HTTP_BRIDGE_HOST_CLOSED');
109
+ }
110
+ return value;
111
+ }
112
+ catch {
113
+ value.removeHostObserver();
114
+ try {
115
+ await value.retire();
116
+ }
117
+ finally {
118
+ value.release();
119
+ }
120
+ throw fail('HTTP_BRIDGE_INSTALL_FAILED');
121
+ }
122
+ }
123
+ owns(url) {
124
+ return (url.startsWith(this.options.prefix) &&
125
+ [undefined, '/', '?'].includes(url[this.options.prefix.length]));
126
+ }
127
+ handleRequest(request, response) {
128
+ if (!this.owns(request.url ?? ''))
129
+ return false;
130
+ if (this.closing || !this.bridge) {
131
+ response.writeHead(503, {
132
+ 'content-type': 'application/json',
133
+ 'cache-control': 'no-store',
134
+ });
135
+ response.end('{"code":"SERVER_CLOSING","message":"Bridge is not accepting requests","retryable":false}');
136
+ return true;
137
+ }
138
+ const hasBody = request.headers['transfer-encoding'] !== undefined ||
139
+ Number(request.headers['content-length'] ?? 0) > 0;
140
+ if (request.body !== undefined || (hasBody && request.readableEnded)) {
141
+ response.writeHead(400, {
142
+ 'content-type': 'application/json',
143
+ 'cache-control': 'no-store',
144
+ });
145
+ response.end('{"code":"BRIDGE_RAW_BODY_REQUIRED","message":"Bridge requires the raw request body","retryable":false}');
146
+ return true;
147
+ }
148
+ this.router.routing(request, response);
149
+ return true;
150
+ }
151
+ handleUpgrade(request, socket, head) {
152
+ if (!this.owns(request.url ?? ''))
153
+ return false;
154
+ if (!this.bridge) {
155
+ socket.end('HTTP/1.1 503 Service Unavailable\r\nConnection: close\r\nContent-Length: 0\r\n\r\n');
156
+ return true;
157
+ }
158
+ return this.bridge.handleUpgrade(request, socket, head);
159
+ }
160
+ diagnostics() {
161
+ if (!this.bridge)
162
+ throw fail('HTTP_BRIDGE_NOT_READY');
163
+ return this.bridge.diagnostics();
164
+ }
165
+ async install() {
166
+ await this.router.register(rdpBridgePlugin, {
167
+ ...this.options,
168
+ upgradeMode: 'manual',
169
+ onReady: (handle) => {
170
+ this.bridge = handle;
171
+ },
172
+ });
173
+ await this.router.ready();
174
+ if (!this.bridge)
175
+ throw fail('HTTP_BRIDGE_NOT_READY');
176
+ if (!this.closing && this.options.upgradeMode !== 'manual') {
177
+ this.removeAutomatic = this.addAutomatic((request, socket, head) => this.handleUpgrade(request, socket, head));
178
+ }
179
+ }
180
+ retire() {
181
+ return (this.retirement ??= (async () => {
182
+ this.removeAutomatic();
183
+ let failed = false;
184
+ try {
185
+ await this.bridge?.close();
186
+ }
187
+ catch {
188
+ failed = true;
189
+ }
190
+ try {
191
+ await this.router.close();
192
+ }
193
+ catch {
194
+ failed = true;
195
+ }
196
+ if (failed)
197
+ throw fail('HTTP_BRIDGE_CLEANUP_FAILED');
198
+ })());
199
+ }
200
+ close() {
201
+ return (this.closing ??= (async () => {
202
+ this.removeHostObserver();
203
+ try {
204
+ await this.initialization?.catch(() => undefined);
205
+ await this.retire();
206
+ }
207
+ finally {
208
+ this.release();
209
+ }
210
+ })());
211
+ }
212
+ }
213
+ /** Prepare routing before listen; the host's one request dispatcher calls handleRequest. */
214
+ export function createRdpBridgeHttp(host, options) {
215
+ return HttpBridge.create(host, options);
216
+ }
217
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAiC,MAAM,SAAS,CAAC;AACxD,OAAO,EACL,MAAM,IAAI,UAAU,GAGrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EACL,eAAe,GAGhB,MAAM,6BAA6B,CAAC;AAkCrC,MAAM,MAAM,GAAG,IAAI,OAAO,EAAgC,CAAC;AAC3D,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAExE,MAAM,UAAU;IAoBuB;IAnB7B,MAAM,CAA2B;IACxB,MAAM,CAAkB;IACjC,cAAc,CAA4B;IAC1C,UAAU,CAA4B;IACtC,OAAO,CAA4B;IACnC,eAAe,GAAe,GAAG,EAAE,CAAC,SAAS,CAAC;IAC9C,kBAAkB,GAAe,GAAG,EAAE,CAAC,SAAS,CAAC;IACjD,YAAY,GAA4C,GAAG,EAAE;QACnE,MAAM,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACtC,CAAC,CAAC;IACM,cAAc,GAAG,KAAK,CAAC;IACvB,OAAO,GAAe,GAAG,EAAE,CAAC,SAAS,CAAC;IAC7B,WAAW,GAAG,GAAG,EAAE;QAClC,IAAI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AAK,CAAC,KAAK,IAAI,EAAE;YACnC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;gBAClD,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;YACtB,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,CAAC;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;IACR,CAAC;CACF;AAED,4FAA4F;AAC5F,MAAM,UAAU,mBAAmB,CACjC,IAAsB,EACtB,OAA6B;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
2
  "name": "@freerdp-bridge/http",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.4",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": ">=24 <25"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "LICENSE",
12
+ "README.md"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./browser": {
20
+ "types": "./dist/browser.d.ts",
21
+ "import": "./dist/browser.js"
22
+ }
23
+ },
24
+ "dependencies": {
25
+ "fastify": "5.12.5",
26
+ "@freerdp-bridge/api": "0.2.4"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/SensNyaha/freerdp-bridge-http.git"
31
+ },
32
+ "scripts": {
33
+ "build": "tsc -b"
34
+ }
6
35
  }