Golang: Gin + Gorilla to build a websocket application
Here we used the gorilla module to build a websocket application, and this tutorial will focus on building up a websoccket server.
About client part will implement with the chrome extension: Websocket King.
Get gorilla module
go get github.com/gorilla/websocket
Build a websocket server
Following are examples of simple websocket servers built with gin and gorilla,
Gin creates a get request and upgrades this HTTP connection to websocket connection by upgrader.Upgrade
.