Documentation
¶
Overview ¶
Package server provides the two HTTP servers for wsproxy:
- terminal.go: :9003 WebSocket terminal reverse-proxy
- internal.go: :9004 internal management API (Gin + OpenAPI-generated routes)
Package server contains the two HTTP servers that wsproxy exposes:
- terminal.go (:9003) — WebSocket terminal proxy toward Worker clusters
- internal.go (:9004) — Internal management API for Dashboard BFF
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BridgeConns ¶
BridgeConns copies messages bidirectionally between two WebSocket connections until one of them closes or returns an error.
func NewInternalServer ¶
func NewInternalServer(cfg *config.Config, deps RouterDeps) *http.Server
NewInternalServer creates the :9004 management HTTP server. It registers the OpenAPI-generated strict routes (templates, api-keys, images catalog) behind jwtOrManagerTokenMiddleware, plus legacy /internal/* routes behind the static manager-token middleware.
func NewTerminalServer ¶
NewTerminalServer creates the :9003 HTTP server that proxies WebSocket terminal connections from the Dashboard to the target Worker cluster.
func ParseTerminalPath ¶
ParseTerminalPath parses a terminal proxy path of the form:
[<prefix>]/ws/clusters/{clusterID}/sandboxes/{sandboxID}/terminal
Returns (clusterID, sandboxID, true) on success, ("", "", false) otherwise.
Types ¶
type RouterDeps ¶
type RouterDeps struct {
SyncManager *syncmgr.SyncManager
AdminKeyMgr *apikey.AdminKeyManager
KeyStore syncmgr.KeyStore
JWTSecret string
ManagerToken string
IAMService service.IAMService
}
RouterDeps bundles all dependencies required to build the internal HTTP router.