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.
This commit is contained in:
parent
fce86b0f0d
commit
5bedcd24e2
@ -206,6 +206,7 @@ func (s *Server) Serve(ln net.Listener) error {
|
|||||||
|
|
||||||
func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
conn, err := websocket.Accept(w, req, &websocket.AcceptOptions{
|
conn, err := websocket.Accept(w, req, &websocket.AcceptOptions{
|
||||||
|
Subprotocols: []string{"text.ircv3.net"}, // non-compliant, fight me
|
||||||
OriginPatterns: s.HTTPOrigins,
|
OriginPatterns: s.HTTPOrigins,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user