Accept accepts a WebSocket handshake from a client and upgrades the connection to a WebSocket. Accept will not allow cross origin requests by default. See the InsecureSkipVerify and OriginPatterns options to allow cross origin requests. Accept will write a response to w on all errors. Note that u
(w http.ResponseWriter, r *http.Request, opts *AcceptOptions)
| 100 | // Note that using the http.Request Context after Accept returns may lead to |
| 101 | // unexpected behavior (see http.Hijacker). |
| 102 | func Accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (*Conn, error) { |
| 103 | return accept(w, r, opts) |
| 104 | } |
| 105 | |
| 106 | func accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (_ *Conn, err error) { |
| 107 | defer errd.Wrap(&err, "failed to accept WebSocket connection") |
searching dependent graphs…