Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSameOrigin ¶
CheckSameOrigin validates that the Origin header matches the Host header, preventing cross-site WebSocket hijacking from malicious web pages.
Types ¶
type ActivitySource ¶
ActivitySource provides activity snapshots for broadcasting. This avoids importing the peer package directly.
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub manages WebSocket connections for state events and tool events
func NewHub ¶
func NewHub(stateMgr *state.Manager, tracker *toolevents.Tracker) *Hub
NewHub creates a new WebSocket hub
func (*Hub) HandleEvents ¶
func (h *Hub) HandleEvents(w http.ResponseWriter, r *http.Request)
HandleEvents handles WebSocket connections for state event streaming
func (*Hub) Run ¶
func (h *Hub) Run()
Run starts broadcasting state events and tool events to connected clients
func (*Hub) SetActivityTracker ¶
func (h *Hub) SetActivityTracker(at *activity.Tracker, peerActivity ActivitySource, localHostID string, localOnly bool)
SetActivityTracker configures the hub to broadcast activity snapshots
type PTYTerminalHandler ¶
type PTYTerminalHandler struct {
// contains filtered or unexported fields
}
PTYTerminalHandler handles WebSocket connections backed by a PTY running tmux attach
func NewPTYTerminalHandler ¶
func NewPTYTerminalHandler(tmuxPath string, activityTracker *activity.Tracker) *PTYTerminalHandler
NewPTYTerminalHandler creates a new PTY-based terminal handler
func (*PTYTerminalHandler) HandleSession ¶
func (h *PTYTerminalHandler) HandleSession(w http.ResponseWriter, r *http.Request)
HandleSession handles a WebSocket connection for an entire tmux session via PTY. Query params: name=<session>, cols=<cols>, rows=<rows>