(r *http.Request, subprotocols []string)
| 264 | } |
| 265 | |
| 266 | func selectSubprotocol(r *http.Request, subprotocols []string) string { |
| 267 | cps := headerTokens(r.Header, "Sec-WebSocket-Protocol") |
| 268 | for _, sp := range subprotocols { |
| 269 | for _, cp := range cps { |
| 270 | if strings.EqualFold(sp, cp) { |
| 271 | return cp |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | return "" |
| 276 | } |
| 277 | |
| 278 | func selectDeflate(extensions []websocketExtension, mode CompressionMode) (*compressionOptions, bool) { |
| 279 | if mode == CompressionDisabled { |
searching dependent graphs…