We will use the gopherjs/websocket/websocketjs package to create a WebSocket connection that will be used to connect to the web server instance.
You can install this package using the following go get command:
$ go get -u github.com/gopherjs/websocket
The client-side implementation of the live chat feature can be found in the client/chat/chat.go source file. We define the ws variable of the type websocketjs.WebSocket and the agentInfo variable of type map[string]string:
var ws *websocketjs.WebSocketvar agentInfo map[string]string
We also declare a constant that represents the key code for the Enter key:
const ENTERKEY int = 13
The GetAgentInfoRequest function is used to obtain the agent information from the ...