@open-probe/proxy
v0.1.2
Published
Reverse proxy that injects open-probe runtime into any dev server.
Maintainers
Readme
@open-probe/proxy
Reverse proxy that injects @open-probe/core into any HTML
response, so you can annotate elements on any dev server (Vite, Next,
Nuxt, SvelteKit, plain Express…) without touching its build config.
Also bundles a minimal hand-rolled WebSocket annotation sink for the
server (ws) transport, so you can pipe annotations to a file, stdout,
or a custom editor integration without an extra service.
Install
pnpm add -D @open-probe/proxyCLI
# Inject open-probe into any dev server
npx open-probe-proxy --target http://localhost:5173 --port 4000
# Plus a WebSocket sink that appends each annotation to a file
npx open-probe-proxy \
--target http://localhost:5173 \
--port 4000 \
--ws --ws-output annotations.jsonl| Flag | Default | Description |
|------|---------|-------------|
| --target <url> | (required) | Upstream dev server to proxy. |
| --port <n> | 4000 | Port the proxy listens on. |
| --host <h> | 127.0.0.1 | Bind address. |
| --transport <t> | clipboard | clipboard / mcp / server. |
| --mcp-endpoint <url> | http://127.0.0.1:3100 | MCP HTTP endpoint when --transport=mcp. |
| --ws | off | Attach a WebSocket annotation sink at --ws-path. |
| --ws-path <p> | /__open-probe/ws | WebSocket upgrade path. |
| --ws-output <f> | stdout | File to append received annotation JSON. |
Programmatic API
import { createServer, attachWsSink } from '@open-probe/proxy';
const server = createServer({
target: 'http://localhost:5173',
port: 4000,
injectScript: { transport: 'mcp', mcpEndpoint: 'http://127.0.0.1:3100' },
});
attachWsSink(server, { path: '/__open-probe/ws', onMessage: ann => save(ann) });License
MIT
