name: Chat Room
sort: 1
Chat Room
This demo shows two ways of implementing a Web Instant Messaging application:
Using long polling. Using WebSocket.
Both of them save data in memory by default so everything will be lost every time the application restarts, but you can change this setting in conf/app.conf to enable a database adapter for data persistence.
Here is the project structure:
WebIM/WebIM.go # File of main packageconfapp.conf # Configuration filecontrollersapp.go # The welcome screen that allows the user to pick a technology and usernamechatroom.go # Functions for data managementlongpolling.go # Controller and methods for long polling chat demowebsocket.go # Controller and methods for WebSocket chat demomodelsarchive.go # Functions of chat data operations for both demos.views... # Template filesstatic... # JavaScript and CSS files
