File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -280,6 +280,15 @@ func WebsocketCloseSprintf(format string, vars ...any) string {
280
280
return msg
281
281
}
282
282
283
+ // OneWayWebSocket establishes a new WebSocket connection that enforces one-way
284
+ // communication from the server to the client.
285
+ //
286
+ // We must use an approach like this instead of Server-Sent Events for the
287
+ // browser, because on HTTP/1.1 connections, browsers are locked to no more than
288
+ // six HTTP connections for a domain total, across all tabs. If a user were to
289
+ // open a workspace in multiple tabs, the entire UI can start to lock up.
290
+ // WebSockets have no such limitation, no matter what HTTP protocol was used to
291
+ // establish the connection.
283
292
func OneWayWebSocket [T any ](rw http.ResponseWriter , r * http.Request ) (
284
293
sendEvent func (wsEvent T ) error ,
285
294
closed chan struct {},
You can’t perform that action at this time.
0 commit comments