Problem to build library centrifuge
beho1der opened this issue · comments
I install library:
$ go get github.com/centrifugal/centrifuge
get error:
../github.com/centrifugal/centrifuge/handler_sockjs.go:129:13: wsUpgrader.WriteBufferPool undefined (type *websocket.Upgrader has no field or method WriteBufferPool)
../github.com/centrifugal/centrifuge/handler_websocket.go:229:10: upgrade.WriteBufferPool undefined (type *websocket.Upgrader has no field or method WriteBufferPool)
@beho1der hello.
If you look at Centrifuge dependency Gorilla WebSocket - you will see that it has WriteBufferPool in Upgrader
struct. So looks like you have an old version of Gorilla WebSocket (I suppose you work with GOPATH ?).
So try to update Gorilla WebSocket:
go get -u github.com/gorilla/websocket
Then run:
go get -u github.com/centrifugal/centrifuge
If this does not help then please provide full information: Go version, directory layout, describe how you work with dependencies in general.
In general with recent Go version and go modules all you need to do is:
mkdir test
cd test
go mod init myproject
go get github.com/centrifugal/centrifuge
Realy github.com/gorilla/websocket, i update and all work