Chat Room

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.go            # File of main package
        app.conf        # Configuration file
        app.go          # The welcome screen that allows the user to pick a technology and username
        chatroom.go     # Functions for data management
        longpolling.go  # Controller and methods for long polling chat demo
        websocket.go    # Controller and methods for WebSocket chat demo
        archive.go      # Functions of chat data operations for both demos.
        ...             # Template files
        ...             # JavaScript and CSS files

Browse the code on GitHub