Open
Conversation
9ac9ddd to
ff60321
Compare
…retrieving, and closing connections
…essaging and base64 encoding for binary data
…e API documentation
ff60321 to
0e665cb
Compare
Contributor
|
I'll take a look at this but may be tomorrow - thanks for the contribution. |
This was referenced Apr 5, 2026
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a WebSocket connection management API to the Admin API and Engine Control API,
providing real-time visibility and control over active WebSocket connections —
mirroring the existing SSE connection management surface.
New Admin API endpoints (
pkg/admin/):GET /websocket/connections— list all active connections with aggregate statsGET /websocket/connections/{id}— inspect a single connection (path, connected time, messages sent/received)DELETE /websocket/connections/{id}— forcibly close a connectionPOST /websocket/connections/{id}/send— push a text or binary message to a specific clientGET /websocket/stats— aggregate counters (total/active connections, messages sent/received, per-mock breakdown)Engine Control API (
pkg/engine/):pkg/engine/api/server.goandhandlers.goListWebSocketConnections,GetWebSocketConnection,CloseWebSocketConnection,SendToWebSocketConnection, andGetWebSocketStatstoControlAPIAdapterincontrol_api.goEngine client (
pkg/admin/engineclient/):WebSocketConnection,WebSocketStats, andWebSocketConnectionListResponsetype aliasesType of Change
Related Issues
Fixes #8
Checklist
go fmtandgo vetgo test ./...)Testing
Unit tests added in
pkg/admin/websocket_handlers_test.goandpkg/admin/engineclient/client_test.go; engine-side tests inpkg/engine/api/handlers_test.go. Coverage includes: