mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: add support for one-way websockets to backend (#16853)
Closes https://github.com/coder/coder/issues/16775 ## Changes made - Added `OneWayWebSocket` function that establishes WebSocket connections that don't allow client-to-server communication - Added tests for the new function - Updated API endpoints to make new WS-based endpoints, and mark previous SSE-based endpoints as deprecated - Updated existing SSE handlers to use the same core logic as the new WS handlers ## Notes - Frontend changes handled via #16855
This commit is contained in:
@ -1248,7 +1248,8 @@ func New(options *Options) *API {
|
||||
httpmw.ExtractWorkspaceParam(options.Database),
|
||||
)
|
||||
r.Get("/", api.workspaceAgent)
|
||||
r.Get("/watch-metadata", api.watchWorkspaceAgentMetadata)
|
||||
r.Get("/watch-metadata", api.watchWorkspaceAgentMetadataSSE)
|
||||
r.Get("/watch-metadata-ws", api.watchWorkspaceAgentMetadataWS)
|
||||
r.Get("/startup-logs", api.workspaceAgentLogsDeprecated)
|
||||
r.Get("/logs", api.workspaceAgentLogs)
|
||||
r.Get("/listening-ports", api.workspaceAgentListeningPorts)
|
||||
@ -1280,7 +1281,8 @@ func New(options *Options) *API {
|
||||
r.Route("/ttl", func(r chi.Router) {
|
||||
r.Put("/", api.putWorkspaceTTL)
|
||||
})
|
||||
r.Get("/watch", api.watchWorkspace)
|
||||
r.Get("/watch", api.watchWorkspaceSSE)
|
||||
r.Get("/watch-ws", api.watchWorkspaceWS)
|
||||
r.Put("/extend", api.putExtendWorkspace)
|
||||
r.Post("/usage", api.postWorkspaceUsage)
|
||||
r.Put("/dormant", api.putWorkspaceDormant)
|
||||
|
Reference in New Issue
Block a user