MCPcopy Create free account
hub / github.com/astercloud/aster / ElectronBridge

Struct ElectronBridge

pkg/desktop/bridge_electron.go:42–53  ·  view source on GitHub ↗

ElectronBridge provides integration with Electron framework. Electron uses a local HTTP server similar to Tauri, but with additional support for Electron's IPC mechanism via WebSocket. Communication flow: 1. Electron preload script connects to localhost:PORT via WebSocket 2. Messages are sent bidir

Source from the content-addressed store, hash-verified

40// // In renderer.js
41// window.aster.chat(agentId, message);
42type ElectronBridge struct {
43 app *App
44 handler MessageHandler
45 agents map[string]*agent.Agent
46 agentsMu sync.RWMutex
47 server *http.Server
48 port int
49 wsClients map[string]*wsClient
50 wsMu sync.RWMutex
51 ctx context.Context
52 cancel context.CancelFunc
53}
54
55// wsClient represents a WebSocket client
56type wsClient struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected