This repository was archived by the owner on May 24, 2023. It is now read-only.

Description
I tried to adapt this example for go fiber v2 websockets
https://gist.github.com/mowings/dad4917b6fc21e6e5ffe2da3b16e7ef9
func main() {
rpc.Register(new(Arith))
http.Handle("/ws", websocket.Handler(serve))
http.ListenAndServe("localhost:7000", nil)
}
func serve(ws *websocket.Conn) {
log.Printf("Handler starting")
jsonrpc.ServeConn(ws)
log.Printf("Handler exiting")
}
I get this error:
cannot use c (variable of type *"github.com/gofiber/websocket/v2".Conn) as io.ReadWriteCloser value in argument to jsonrpc.NewClient: *"github.com/gofiber/websocket/v2".Conn does not implement io.ReadWriteCloser (missing method Read)
Is there a way to adapt golang.org/x/net/websocket to be used with go fiber websockets?