From 5bedcd24e2ba621b32dc7c19635ca788bdf20f8e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 28 Sep 2021 21:25:06 +0200 Subject: [PATCH] Add support for IRCv3 WebSocket text subprotocol Technically we aren't spec-compliant since we don't serve binary.ircv3.net. Any complaints will be redirected to /dev/null. --- server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server.go b/server.go index db08a73..f09492a 100644 --- a/server.go +++ b/server.go @@ -206,6 +206,7 @@ func (s *Server) Serve(ln net.Listener) error { func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { conn, err := websocket.Accept(w, req, &websocket.AcceptOptions{ + Subprotocols: []string{"text.ircv3.net"}, // non-compliant, fight me OriginPatterns: s.HTTPOrigins, }) if err != nil {