Accept "irc" WebSocket subprotocol
This commit is contained in:
parent
3397965dea
commit
82990fb774
@ -146,6 +146,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{
|
||||||
OriginPatterns: s.HTTPOrigins,
|
OriginPatterns: s.HTTPOrigins,
|
||||||
|
Subprotocols: []string{"irc"},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.Logger.Printf("failed to serve HTTP connection: %v", err)
|
s.Logger.Printf("failed to serve HTTP connection: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user