(message string, code string)
| 358 | } |
| 359 | |
| 360 | func (w *wsResponseWriter) fail(message string, code string) error { |
| 361 | w.mu.Lock() |
| 362 | defer w.mu.Unlock() |
| 363 | if w.completed { |
| 364 | return nil |
| 365 | } |
| 366 | w.completed = true |
| 367 | return w.sink.sinkError(message, code) |
| 368 | } |
| 369 | |
| 370 | // CopilotWebSocketForwarder is the default [CopilotWebSocketHandler]: |
| 371 | // it dials the real upstream and runs a receive loop forwarding upstream→runtime |