diff --git a/relay/server/listener/ws/listener.go b/relay/server/listener/ws/listener.go index d93dfe0c3..b53e97505 100644 --- a/relay/server/listener/ws/listener.go +++ b/relay/server/listener/ws/listener.go @@ -36,10 +36,12 @@ func NewListener(address string) listener.Listener { // Listen todo: prevent multiple call func (l *Listener) Listen(acceptFn func(conn net.Conn)) error { l.acceptFn = acceptFn - http.HandleFunc("/", l.onAccept) + mux := http.NewServeMux() + mux.HandleFunc("/", l.onAccept) l.server = &http.Server{ - Addr: l.address, + Addr: l.address, + Handler: mux, } log.Infof("WS server is listening on address: %s", l.address)