O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the live chat's server-side functionality

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:

https://github.com/gorilla/websocket/tree/master/examples/chat.

Rather than reinventing the wheel, we will repurpose Gorilla's example web chat application to fulfill the live chat feature. The source ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required