Add HTTP server mode with native node:http

Reintroduce server mode (removed in 3014cf9) using node:http instead of
Express — zero new dependencies. Accepts JSON commands via POST to /,
returns JSON responses with CORS support. Screenshot command returns
base64 data when no path is specified.

- Add src/server.ts with BrowserServer class using node:http
- Add -s/--server <port> CLI flag (default 13373)
- Export BrowserServer and startServer from index.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-25 16:23:16 +02:00
parent a80224df36
commit 1426ec9173
14 changed files with 228 additions and 33 deletions
+1
View File
@@ -1,3 +1,4 @@
export { ClaudeBrowser } from './browser.js';
export { BrowserServer, startServer } from './server.js';
export { createFavicon, convert, resize, crop, compress, thumbnail, } from './image.js';
//# sourceMappingURL=index.js.map