I got an error message: cannot use websocket.Handler(handler) (type websocket.Handler) as type func(http.ResponseWriter, *http.Request) in argument to mx.HandleFunc
in following code
package main
import (
"golang.org/x/net/websocket"
"net/http"
)
func handler(ws *websocket.Conn) {
// TODO
}
func main() {
mx := http.NewServeMux()
mx.HandleFunc("/ws", websocket.Handler(handler)) // error
http.ListenAndServe("localhost:8888", mx)
}