When the live chat feature is activated, we will create a persistent, WebSocket connection, between the web client and the web server. The Gorilla Web Toolkit provides an excellent implementation of the WebSocket protocol in their websocket package, which can be found at http://github.com/gorilla/websocket. To fetch the websocket package, you may issue the following command:
$ go get github.com/gorilla/websocket
The Gorilla web toolkit also provides a useful example web chat application:
Rather than reinventing the wheel, we will repurpose Gorilla's example web chat application to fulfill the live chat feature. The source ...