lganzzzo / canchat

Feature-complete rooms-based chat for tens of thousands users. Client plus Server. Built with Oat++ Web Framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can-Chat Build Status

Can-Chat

Feature-complete rooms-based chat for tens of thousands users. Client plus Server. Built with Oat++ Web Framework.
Single-Node In-Memory WebSocket TLS.

Quick Start

  • Run your own chat in Docker:
    docker run -p 8443:8443 -e EXTERNAL_ADDRESS=localhost -e EXTERNAL_PORT=8443 -it lganzzzo/canchat
  • Build from source

Chat

Rooms

All communication happens in chat-rooms.
Each room has a unique URL.
Anyone who has room-URL can join the room. Generating random long enough room-URL gives privacy to participants. Be sure to share room-URL with wanted participants only.

Rooms are automatically created when the first participant joins the room, and are automatically deleted when the last participant leaves the room.

Chat-history is available for newly joined participants. History is rounded when the number of messages in the room exceeds the maxRoomHistoryMessages config parameter. History is deleted and no-longer-available once the room is deleted.

File Sharing

Users can share multiple files at once.

Files are streamed directly from the host-peer machine. Nothing is uploaded to the server nor stored in any 3d-party place.

Once host-peer cancels file-sharing, files are no longer available.
If host-peer exits the room, all of his file-sharing is canceled.

Build And Run

Build From Source

Pre-Requirements

  • Install LibreSSL version 3.0.0 or later.
  • Install oatpp - Oat++ Web Framework (main module)
  • Install oatpp-websocket - Oat++ WebSocket extension module.
  • Install oatpp-libressl - Libressl adaptor for Oat++.

To install oatpp modules you can use utility/install-oatpp-modules.sh script

Build Chat Server

$ cd <this-repo>/server/
$ mkdir build/ && cd build/
$ cmake ..
$ make

Now run chat server

$ canchat-exe --host localhost --port 8443

Docker

$ docker build -t canchat .
$ docker run -p 8443:8443 -e EXTERNAL_ADDRESS=localhost -e EXTERNAL_PORT=8443 -it canchat

Then goto https://localhost:8443/ in browser. (accept self-signed certificate)

Image parameters:

  • -e EXTERNAL_ADDRESS - Address to which the client is supposed to connect to.
  • -e EXTERNAL_PORT - Port at EXTERNAL_ADDRESS to which the client is supposed to connect to. Chat server will also be running on this port.
  • -e TLS_FILE_PRIVATE_KEY - Path to TLS private-key file.
  • -e TLS_FILE_CERT_CHAIN - Path to TLS certificate chain file.

Repository Content

- front/                            # - Front-end sources are here
- server/                           # - Server sources are here
- cert/                             # - test TLS certificate is here
- utility/
    |
    |- install-oatpp-modules.sh     # - useful script to install required oatpp modules

License

This project is released under Apache License 2.0.


Enjoy!

About

Feature-complete rooms-based chat for tens of thousands users. Client plus Server. Built with Oat++ Web Framework.

License:Apache License 2.0


Languages

Language:C++ 65.2%Language:JavaScript 16.2%Language:HTML 15.8%Language:CMake 1.9%Language:Shell 0.7%Language:Dockerfile 0.2%