Skip to content

Commit

Permalink
Merge pull request #2459 from headlamp-k8s/websocket-multiplexer
Browse files Browse the repository at this point in the history
backend: Add websocket multiplexer
  • Loading branch information
illume authored Oct 24, 2024
2 parents 0979b16 + bf2ec6d commit dd9697a
Show file tree
Hide file tree
Showing 4 changed files with 1,064 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/cmd/headlamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type HeadlampConfig struct {
proxyURLs []string
cache cache.Cache[interface{}]
kubeConfigStore kubeconfig.ContextStore
multiplexer *Multiplexer
}

const DrainNodeCacheTTL = 20 // seconds
Expand Down Expand Up @@ -1599,6 +1600,9 @@ func (c *HeadlampConfig) addClusterSetupRoute(r *mux.Router) {

// Rename a cluster
r.HandleFunc("/cluster/{name}", c.renameCluster).Methods("PUT")

// Websocket connections
r.HandleFunc("/wsMutliplexer", c.multiplexer.HandleClientWebSocket)
}

/*
Expand Down
Loading

0 comments on commit dd9697a

Please sign in to comment.