Accept "irc" WebSocket subprotocol

git-svn-id: file:///srv/svn/repo/suika/trunk@348 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
contact 2020-07-02 09:05:49 +00:00
parent 51df0c157e
commit 3367f4ebd8

View File

@ -146,6 +146,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{
OriginPatterns: s.HTTPOrigins,
Subprotocols: []string{"irc"},
})
if err != nil {
s.Logger.Printf("failed to serve HTTP connection: %v", err)