Handle is the HTTP handler for WebSocket upgrade requests. Route: GET /v1/agents/{email}/ws — authenticated by `Authorization: Bearer `. Handle reads the agent email from the gorilla/mux route var.
(w http.ResponseWriter, r *http.Request)
| 38 | // Route: GET /v1/agents/{email}/ws — authenticated by `Authorization: Bearer <api_key>`. |
| 39 | // Handle reads the agent email from the gorilla/mux route var. |
| 40 | func (h *Handler) Handle(w http.ResponseWriter, r *http.Request) { |
| 41 | h.serve(w, r, mux.Vars(r)["email"]) |
| 42 | } |
| 43 | |
| 44 | // ServeWithEmail handles the WebSocket upgrade for an explicitly-provided |
| 45 | // agent email, so non-mux routers (chi at /v1/agents/{address}/ws) can host |